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
2010-05-01 12:20:39 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6d4a3f1dbf6c18d88883d931f7c0c5686423d02d
6d4a3f1d
1 parent
74a108cf
Stop sending a charset header for file uploads in ASIFormDataRequest
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
3 deletions
Classes/ASIFormDataRequest.m
Classes/ASIHTTPRequest.m
Classes/Tests/ASIFormDataRequestTests.m
Classes/ASIFormDataRequest.m
View file @
6d4a3f1
...
...
@@ -200,7 +200,7 @@
NSString
*
fileName
=
[
fileInfo
objectForKey
:
@"fileName"
];
[
self
appendPostString
:[
NSString
stringWithFormat
:
@"Content-Disposition: form-data; name=
\"
%@
\"
; filename=
\"
%@
\"\r\n
"
,
key
,
fileName
]];
[
self
appendPostString
:[
NSString
stringWithFormat
:
@"Content-Type: %@
; charset=%@
\r\n\r\n
"
,
contentType
,
charset
]];
[
self
appendPostString
:[
NSString
stringWithFormat
:
@"Content-Type: %@
\r\n\r\n
"
,
contentType
]];
if
([
file
isKindOfClass
:[
NSString
class
]])
{
[
self
appendPostDataFromFile
:
file
];
...
...
Classes/ASIHTTPRequest.m
View file @
6d4a3f1
...
...
@@ -23,7 +23,7 @@
// Automatically set on build
NSString
*
ASIHTTPRequestVersion
=
@"v1.6.2-
7
2010-05-01"
;
NSString
*
ASIHTTPRequestVersion
=
@"v1.6.2-
8
2010-05-01"
;
NSString
*
const
NetworkRequestErrorDomain
=
@"ASIHTTPRequestErrorDomain"
;
...
...
Classes/Tests/ASIFormDataRequestTests.m
View file @
6d4a3f1
...
...
@@ -176,7 +176,16 @@
[
request
setStringEncoding
:
NSWindowsCP1252StringEncoding
];
[
request
startSynchronous
];
success
=
([[
request
responseString
]
isEqualToString
:[
NSString
stringWithFormat
:
@"Got data in %@: %@"
,
charset
,
testString
]]);
GHAssertTrue
(
success
,
@"Failed to correctly encode the data"
);
GHAssertTrue
(
success
,
@"Failed to correctly encode the data"
);
// Ensure charset isn't added to file post (GH issue 36)
request
=
[
ASIFormDataRequest
requestWithURL
:[
NSURL
URLWithString
:
@"http://allseeing-i.com/ASIHTTPRequest/Tests/return-raw-request"
]];
[
request
setData
:[
@"test 123"
dataUsingEncoding
:
NSUTF8StringEncoding
]
forKey
:
@"file"
];
[
request
setRequestMethod
:
@"PUT"
];
[
request
startSynchronous
];
success
=
([[
request
responseString
]
rangeOfString
:
@"charset=utf-8"
].
location
==
NSNotFound
);
GHAssertTrue
(
success
,
@"Sent a charset header for an uploaded file"
);
}
...
...
Please
register
or
login
to post a comment