Toggle navigation
Toggle navigation
This project
Loading...
Sign in
iOS
/
asi-http-request
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Ben Copsey
2009-06-21 14:09:32 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4d26738f1f43b75b9c1036b5a663f6d4225d68af
4d26738f
1 parent
148d67e1
Added new files to mac project
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
Classes/Tests/ASIHTTPRequestTests.m
Mac.xcodeproj/project.pbxproj
Classes/Tests/ASIHTTPRequestTests.m
View file @
4d26738
...
...
@@ -372,12 +372,16 @@
// Test setting a custom cookie works
NSDictionary
*
cookieProperties
=
[[[
NSMutableDictionary
alloc
]
init
]
autorelease
];
[
cookieProperties
setValue
:
@"Test Value"
forKey
:
NSHTTPCookieValue
];
// We'll add a line break to our cookie value to test it gets correctly encoded
[
cookieProperties
setValue
:[
@"Test
\r\n
Value"
encodedCookieValue
]
forKey
:
NSHTTPCookieValue
];
[
cookieProperties
setValue
:
@"ASIHTTPRequestTestCookie"
forKey
:
NSHTTPCookieName
];
[
cookieProperties
setValue
:
@"allseeing-i.com"
forKey
:
NSHTTPCookieDomain
];
[
cookieProperties
setValue
:[
NSDate
dateWithTimeIntervalSinceNow
:
60
*
60
*
4
]
forKey
:
NSHTTPCookieExpires
];
[
cookieProperties
setValue
:
@"/ASIHTTPRequest/tests"
forKey
:
NSHTTPCookiePath
];
cookie
=
[[[
NSHTTPCookie
alloc
]
initWithProperties
:
cookieProperties
]
autorelease
];
GHAssertNotNil
(
cookie
,
@"Failed to create a cookie - cookie value was not correctly encoded?"
);
url
=
[[[
NSURL
alloc
]
initWithString
:
@"http://allseeing-i.com/ASIHTTPRequest/tests/read_cookie"
]
autorelease
];
request
=
[[[
ASIHTTPRequest
alloc
]
initWithURL
:
url
]
autorelease
];
...
...
@@ -385,7 +389,7 @@
[
request
setRequestCookies
:[
NSMutableArray
arrayWithObject
:
cookie
]];
[
request
start
];
html
=
[
request
responseString
];
success
=
[
html
isEqualToString
:
@"I have 'Test
Value' as the value of 'ASIHTTPRequestTestCookie'"
];
success
=
[
html
isEqualToString
:
@"I have 'Test
\r\n
Value' as the value of 'ASIHTTPRequestTestCookie'"
];
GHAssertTrue
(
success
,
@"Custom cookie not presented to the server with cookie persistance OFF"
);
...
...
Mac.xcodeproj/project.pbxproj
View file @
4d26738
This diff was suppressed by a .gitattributes entry.
Please
register
or
login
to post a comment