Skip to content

Commit

Permalink
Tweak MMMCurlStringFromRequest() to use --location-trusted
Browse files Browse the repository at this point in the history
  • Loading branch information
aleh committed Oct 18, 2023
1 parent 96eca7f commit a05d527
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion MMMCommonCore.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Pod::Spec.new do |s|

s.name = "MMMCommonCore"
s.version = "1.16.0"
s.version = "1.16.1"
s.summary = "Small bits and pieces reused in many pods from MMMTemple"
s.description = s.summary
s.homepage = "https://github.com/mediamonks/#{s.name}"
Expand Down
5 changes: 4 additions & 1 deletion Sources/MMMCommonCoreObjC/MMMCommonCore.m
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,11 @@ - (id)mmm_stripNSNull {

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

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

0 comments on commit a05d527

Please sign in to comment.