File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import (
1010 "io"
1111 "math"
1212 "math/rand"
13+ "mime"
1314 "net/http"
1415 "net/url"
1516 "runtime"
@@ -485,7 +486,8 @@ func (cfg *RequestConfig) Execute() (err error) {
485486
486487 // If we are not json, return plaintext
487488 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" )
489491 if ! isJSON {
490492 switch dst := cfg .ResponseBodyInto .(type ) {
491493 case * string :
@@ -496,7 +498,7 @@ func (cfg *RequestConfig) Execute() (err error) {
496498 case * []byte :
497499 * dst = contents
498500 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 )
500502 }
501503 return nil
502504 }
Original file line number Diff line number Diff line change 44
55cd " $( dirname " $0 " ) /.."
66
7- if [ -f " Brewfile" ] && [ " $( uname -s) " = " Darwin" ]; then
7+ if [ -f " Brewfile" ] && [ " $( uname -s) " = " Darwin" ] && [ " $SKIP_BREW " != " 1 " ] ; then
88 brew bundle check > /dev/null 2>&1 || {
99 echo " ==> Installing Homebrew dependencies…"
1010 brew bundle
You can’t perform that action at this time.
0 commit comments