Differences From Artifact [2209074f5b]:
- File
src/OFURL.m
— part of check-in
[d2487bc7e1]
at
2014-07-07 00:50:01
on branch trunk
— OFURL: Don't include the leading "/" in path
While Cocoa includes it, RFC 1738 explicitly states that the "/" between
host / port and path is not part of the path. (user: js, size: 10442) [annotate] [blame] [check-ins using]
To Artifact [5ebb65d404]:
- File src/OFURL.m — part of check-in [65afbedbd4] at 2014-07-07 22:28:00 on branch trunk — OFURL: Allow all RFC 1808 compatible schemes (user: js, size: 10265) [annotate] [blame] [check-ins using]
︙ | |||
14 15 16 17 18 19 20 21 22 23 24 25 26 27 | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | + | * file. */ #include "config.h" #include <stdlib.h> #include <string.h> #include <ctype.h> #import "OFURL.h" #import "OFString.h" #import "OFArray.h" #import "OFXMLElement.h" #import "OFInvalidArgumentException.h" |
︙ | |||
53 54 55 56 57 58 59 | 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | - - + + + + - - - - + + + + + + - - - - - - - - + + + + + + + + - + | self = [super init]; @try { char *tmp, *tmp2; if ((UTF8String2 = of_strdup([string UTF8String])) == NULL) @throw [OFOutOfMemoryException |
︙ | |||
116 117 118 119 120 121 122 | 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | - - - - - + + | portString = [OFString stringWithUTF8String: tmp2]; if ([portString decimalValue] > 65535) @throw [OFInvalidFormatException exception]; _port = [portString decimalValue]; |
︙ | |||
362 363 364 365 366 367 368 | 364 365 366 367 368 369 370 371 372 373 374 375 376 377 | - - - | - (OFString*)scheme { OF_GETTER(_scheme, true) } - (void)setScheme: (OFString*)scheme { |
︙ | |||
415 416 417 418 419 420 421 | 414 415 416 417 418 419 420 421 422 423 424 425 426 427 | - - - - | - (OFString*)path { OF_GETTER(_path, true) } - (void)setPath: (OFString*)path { |
︙ | |||
473 474 475 476 477 478 479 | 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 | - + + | else if (_user != nil) [ret appendFormat: @"%@@", _user]; if (_host != nil) [ret appendString: _host]; if (([_scheme isEqual: @"http"] && _port != 80) || |
︙ |