File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -975,6 +975,10 @@ extension NSURLSessionTask.EasyHandle {
975
975
func setPassHeadersToDataStream( flag: Bool ) {
976
976
try ! CFURLSession_easy_setopt_long ( rawHandle, CFURLSession_OptionHEADER, flag ? 1 : 0 ) . asError ( )
977
977
}
978
+ /// Follow any Location: header that the server sends as part of a HTTP header in a 3xx response
979
+ func setFollowLocation( flag: Bool ) {
980
+ try ! CFURLSession_easy_setopt_long ( rawHandle, CFURLSession_OptionFOLLOWLOCATION, flag ? 1 : 0 ) . asError ( )
981
+ }
978
982
/// Switch off the progress meter. It will also prevent the CFURLSession_OptionPROGRESSFUNCTION from getting called.
979
983
func setProgressMeterOff( flag: Bool ) {
980
984
try ! CFURLSession_easy_setopt_long ( rawHandle, CFURLSession_OptionNOPROGRESS, flag ? 1 : 0 ) . asError ( )
@@ -1144,6 +1148,8 @@ private extension NSURLSessionTask.EasyHandle {
1144
1148
return NSURLErrorNetworkConnectionLost
1145
1149
case ( CFURLSession_EasyCodeSEND_ERROR, ECONNRESET) :
1146
1150
return NSURLErrorNetworkConnectionLost
1151
+ case ( CFURLSession_EasyCodeGOT_NOTHING, _) :
1152
+ return NSURLErrorBadServerResponse
1147
1153
default :
1148
1154
//TODO: Need to map to one of the NSURLError... constants
1149
1155
NSUnimplemented ( )
Original file line number Diff line number Diff line change @@ -840,6 +840,9 @@ private extension NSURLSessionTask {
840
840
//
841
841
// The `HTTPBody` and `HTTPBodyStream` methods are missing from `NSURLRequest` ?!?
842
842
}
843
+
844
+ // HTTP Options:
845
+ easyHandle. setFollowLocation ( false )
843
846
easyHandle. setCustomHeaders ( [ ] ) //TODO: Fix headers
844
847
easyHandle. setDisableContentDecoding ( )
845
848
easyHandle. setWaitForPipeliningAndMultiplexing ( true )
You can’t perform that action at this time.
0 commit comments