diff options
| author | 2024-02-14 12:07:58 +0000 | |
|---|---|---|
| committer | 2024-02-14 13:07:58 +0100 | |
| commit | 8b8211986e222109880a2bb03aaee99958ea67fb (patch) | |
| tree | b030e90a0317de30ebf9d5cd54f8db6864773873 | |
| parent | [bugfix] add stricter checks during all stages of dereferencing remote AS obj... (diff) | |
| download | gotosocial-8b8211986e222109880a2bb03aaee99958ea67fb.tar.xz | |
[chore] also allow text/xml in place of application/xml (#2640)
| -rw-r--r-- | internal/api/util/mime.go | 5 | 
1 files changed, 4 insertions, 1 deletions
diff --git a/internal/api/util/mime.go b/internal/api/util/mime.go index 455a84de9..1e183d8e0 100644 --- a/internal/api/util/mime.go +++ b/internal/api/util/mime.go @@ -23,6 +23,7 @@ const (  	// Possible GoToSocial mimetypes.  	AppJSON           = `application/json`  	AppXML            = `application/xml` +	appXMLText        = `text/xml` // AppXML is only *recommended* in RFC7303  	AppXMLXRD         = `application/xrd+xml`  	AppRSSXML         = `application/rss+xml`  	AppActivityJSON   = `application/activity+json` @@ -58,7 +59,8 @@ func XMLContentType(ct string) bool {  	p := splitContentType(ct)  	p, ok := isUTF8ContentType(p)  	return ok && len(p) == 1 && -		p[0] == AppXML +		p[0] == AppXML || +		p[0] == appXMLText  }  // XMLXRDContentType returns whether is application/(xrd+)?xml(;charset=utf-8)? content-type. @@ -67,6 +69,7 @@ func XMLXRDContentType(ct string) bool {  	p, ok := isUTF8ContentType(p)  	return ok && len(p) == 1 &&  		p[0] == AppXML || +		p[0] == appXMLText ||  		p[0] == AppXMLXRD  }  | 
