Skip to content

Commit

Permalink
Add support for additional content types
Browse files Browse the repository at this point in the history
- text/plain
- application/octet-stream
- application/json [contained in]
  • Loading branch information
chayev committed Jan 21, 2021
1 parent 4452c20 commit 7d43c71
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion yurllib/aasa.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"io/ioutil"
"net/http"
"net/url"
"strings"

"go.mozilla.org/pkcs7"
)
Expand Down Expand Up @@ -50,7 +51,7 @@ func CheckDomain(inputURL string, bundleIdentifier string, teamIdentifier string
output = append(output, fmt.Sprintf("Content-type: \t\t\t %s \n", contentType))

isEncryptedMimeType := contentType[0] == "application/pkcs7-mime"
isJSONMimeType := contentType[0] == "application/json" || contentType[0] == "text/json"
isJSONMimeType := contentType[0] == "application/json" || contentType[0] == "text/json" || contentType[0] == "text/plain" || strings.Contains(contentType[0], "application/json") || contentType[0] == "application/octet-stream"
isJSONTypeOK := allowUnencrypted && isJSONMimeType // Only ok if both the "allow" flag is true, and... it's a valid type.

result, err := ioutil.ReadAll(rawResult.Body)
Expand Down

0 comments on commit 7d43c71

Please sign in to comment.