Overview
Comment: | +[OFHTTPCookie requestHeaderFieldsWithCookies:]
Also renames +[OFHTTPCookie cookiesFromHeaders:forURL:] to |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
8896ef883ebedf30216c7462f0f6f59c |
User & Date: | js on 2017-05-27 08:56:47 |
Other Links: | manifest | tags |
Context
2017-05-27
| ||
10:08 | Make things work with glibc 2.17 and Clang 3.4.2 check-in: ec36a82d68 user: js tags: trunk | |
08:56 | +[OFHTTPCookie requestHeaderFieldsWithCookies:] check-in: 8896ef883e user: js tags: trunk | |
2017-05-25
| ||
15:09 | -[OFMutableDictionary addEntiresFromDictionary:] check-in: 88a584a16f user: js tags: trunk | |
Changes
Modified src/OFHTTPClient.h from [7523e2d4b7] to [b76c7b05e7].
︙ | |||
79 80 81 82 83 84 85 | 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | - + + + + + | * This callback will only be called if the OFHTTPClient will follow a * redirect. If the maximum number of redirects has been reached already, this * callback will not be called. * * @param client The OFHTTPClient which wants to follow a redirect * @param URL The URL to which it will follow a redirect * @param statusCode The status code for the redirection |
︙ |
Modified src/OFHTTPCookie.h from [a02e34311d] to [b3a1f16ba1].
︙ | |||
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - | /*! * An array of other attributes. */ @property (readonly, nonatomic) OFMutableArray OF_GENERIC(OFString *) *extensions; /*! * @brief Parses the specified response header fields for the specified URL and * returns an array of cookies. * * @param headerFields The response header fields to parse * @param URL The URL for the response header fields to parse * @return An array of cookies */ + (OFArray OF_GENERIC(OFHTTPCookie *) *)cookiesWithResponseHeaderFields: (OFDictionary OF_GENERIC(OFString *, OFString *) *)headerFields forURL: (OFURL *)URL; /*! * @brief Returns the request header fields for the specified cookies. * * @param cookies The cookies to return the request header fields for * @return The request header fields for the specified cookies */ + (OFDictionary *)requestHeaderFieldsWithCookies: (OFArray OF_GENERIC(OFHTTPCookie *) *)cookies; /*! * @brief Create a new cookie with the specified name and value. * * @param name The name of the cookie * @param value The value of the cookie * @param domain The domain for the cookie * @return A new, autoreleased OFHTTPCookie */ + (instancetype)cookieWithName: (OFString *)name value: (OFString *)value domain: (OFString *)domain; |
︙ |
Modified src/OFHTTPCookie.m from [fe9eb6c85d] to [13073ad757].
︙ | |||
57 58 59 60 61 62 63 | 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | - - - - - - - - - - - + + - + | } @implementation OFHTTPCookie @synthesize name = _name, value = _value, domain = _domain, path = _path; @synthesize expires = _expires, secure = _secure, HTTPOnly = _HTTPOnly; @synthesize extensions = _extensions; |
︙ | |||
253 254 255 256 257 258 259 260 261 262 263 264 265 266 | 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | break; } objc_autoreleasePoolPop(pool); return ret; } + (OFDictionary *)requestHeaderFieldsWithCookies: (OFArray OF_GENERIC(OFHTTPCookie *) *)cookies { OFDictionary OF_GENERIC(OFString *, OFString *) *ret; void *pool; OFMutableString *cookieString; bool first = true; if ([cookies count] == 0) return [OFDictionary dictionary]; pool = objc_autoreleasePoolPush(); cookieString = [OFMutableString string]; for (OFHTTPCookie *cookie in cookies) { if OF_UNLIKELY (first) first = false; else [cookieString appendString: @"; "]; [cookieString appendString: [cookie name]]; [cookieString appendString: @"="]; [cookieString appendString: [cookie value]]; } ret = [[OFDictionary alloc] initWithObject: cookieString forKey: @"Cookie"]; objc_autoreleasePoolPop(pool); return [ret autorelease]; } + (instancetype)cookieWithName: (OFString *)name value: (OFString *)value domain: (OFString *)domain { return [[[self alloc] initWithName: name value: value domain: domain] autorelease]; } - init { OF_INVALID_INIT_METHOD } - initWithName: (OFString *)name |
︙ |
Modified tests/OFHTTPCookieTests.m from [c2cad19355] to [65bd4b5a54].
︙ | |||
29 30 31 32 33 34 35 36 37 38 39 | 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 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 | + - - + + - - + + - - - + + + - + + + + + + | @implementation TestsAppDelegate (OFHTTPCookieTests) - (void)HTTPCookieTests { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFURL *URL = [OFURL URLWithString: @"http://heap.zone"]; OFHTTPCookie *cookie[2]; OFArray OF_GENERIC(OFHTTPCookie *) *cookies; cookie[0] = [OFHTTPCookie cookieWithName: @"foo" value: @"bar" domain: @"heap.zone"]; |