File tree 2 files changed +5
-3
lines changed
2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import (
10
10
"io"
11
11
"math"
12
12
"math/rand"
13
+ "mime"
13
14
"net/http"
14
15
"net/url"
15
16
"runtime"
@@ -485,7 +486,8 @@ func (cfg *RequestConfig) Execute() (err error) {
485
486
486
487
// If we are not json, return plaintext
487
488
contentType := res .Header .Get ("content-type" )
488
- isJSON := strings .Contains (contentType , "application/json" ) || strings .Contains (contentType , "application/vnd.api+json" )
489
+ mediaType , _ , _ := mime .ParseMediaType (contentType )
490
+ isJSON := strings .Contains (mediaType , "application/json" ) || strings .HasSuffix (mediaType , "+json" )
489
491
if ! isJSON {
490
492
switch dst := cfg .ResponseBodyInto .(type ) {
491
493
case * string :
@@ -496,7 +498,7 @@ func (cfg *RequestConfig) Execute() (err error) {
496
498
case * []byte :
497
499
* dst = contents
498
500
default :
499
- return fmt .Errorf ("expected destination type of 'string' or '[]byte' for responses with content-type that is not 'application/json'" )
501
+ return fmt .Errorf ("expected destination type of 'string' or '[]byte' for responses with content-type '%s' that is not 'application/json'" , contentType )
500
502
}
501
503
return nil
502
504
}
Original file line number Diff line number Diff line change 4
4
5
5
cd " $( dirname " $0 " ) /.."
6
6
7
- if [ -f " Brewfile" ] && [ " $( uname -s) " = " Darwin" ]; then
7
+ if [ -f " Brewfile" ] && [ " $( uname -s) " = " Darwin" ] && [ " $SKIP_BREW " != " 1 " ] ; then
8
8
brew bundle check > /dev/null 2>&1 || {
9
9
echo " ==> Installing Homebrew dependencies…"
10
10
brew bundle
You can’t perform that action at this time.
0 commit comments