Skip to content

Commit a05d527

Browse files
committed
Tweak MMMCurlStringFromRequest() to use --location-trusted
1 parent 96eca7f commit a05d527

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

MMMCommonCore.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Pod::Spec.new do |s|
77

88
s.name = "MMMCommonCore"
9-
s.version = "1.16.0"
9+
s.version = "1.16.1"
1010
s.summary = "Small bits and pieces reused in many pods from MMMTemple"
1111
s.description = s.summary
1212
s.homepage = "https://github.com/mediamonks/#{s.name}"

Sources/MMMCommonCoreObjC/MMMCommonCore.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,11 @@ - (id)mmm_stripNSNull {
155155

156156
NSString *dataBinary = [[NSString alloc] initWithData:request.HTTPBody encoding:NSUTF8StringEncoding];
157157

158+
// `--location-trusted` allows to keep "Authorization" header while being redirected (the behavior of NSURLSession).
159+
// `-i` is to include response headers into output; adding it last so it's easy to disable headers when one wants
160+
// to pipe the response out.
158161
return [NSString
159-
stringWithFormat:@"curl -i -X %@ '%@' %@ --data-binary '%@'",
162+
stringWithFormat:@"curl -X %@ '%@' %@ --data-binary '%@' --location-trusted -i",
160163
request.HTTPMethod,
161164
request.URL,
162165
headers,

0 commit comments

Comments
 (0)