ObjFW  Diff

Differences From Artifact [eb2ac21f4b]:

To Artifact [7266c82110]:


14
15
16
17
18
19
20

21
22
23
24
25
26
27
 * file.
 */

#include "config.h"

#import "OFHTTPCookieManager.h"
#import "OFArray.h"

#import "OFHTTPCookie.h"
#import "OFURL.h"

@implementation OFHTTPCookieManager
+ (instancetype)manager
{
	return [[[self alloc] init] autorelease];







>







14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 * file.
 */

#include "config.h"

#import "OFHTTPCookieManager.h"
#import "OFArray.h"
#import "OFDate.h"
#import "OFHTTPCookie.h"
#import "OFURL.h"

@implementation OFHTTPCookieManager
+ (instancetype)manager
{
	return [[[self alloc] init] autorelease];
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
- (void)addCookie: (OFHTTPCookie *)cookie
	   forURL: (OFURL *)URL
{
	void *pool = objc_autoreleasePoolPush();
	OFString *cookieDomain, *URLHost;
	size_t i;

	if ([cookie domain] == nil)
		[cookie setDomain: [URL host]];

	if ([cookie path] == nil || ![[cookie path] hasPrefix: @"/"])
		[cookie setPath: @"/"];

	if ([cookie isSecure] && ![[URL scheme] isEqual: @"https"]) {
		objc_autoreleasePoolPop(pool);
		return;
	}








<
<
<
|







57
58
59
60
61
62
63



64
65
66
67
68
69
70
71
- (void)addCookie: (OFHTTPCookie *)cookie
	   forURL: (OFURL *)URL
{
	void *pool = objc_autoreleasePoolPush();
	OFString *cookieDomain, *URLHost;
	size_t i;




	if (![[cookie path] hasPrefix: @"/"])
		[cookie setPath: @"/"];

	if ([cookie isSecure] && ![[URL scheme] isEqual: @"https"]) {
		objc_autoreleasePoolPop(pool);
		return;
	}