mirror of
https://codeberg.org/git-pages/git-pages.git
synced 2026-08-21 19:36:04 +00:00
Fix several content type negotiation issues.
* No `Accept:` header should be the same as `Accept: */*`. * For unresolved reference error, `text/plain` should take priority.
This commit is contained in:
+1
-1
@@ -575,7 +575,7 @@ func patchPage(w http.ResponseWriter, r *http.Request) error {
|
||||
func reportUpdateResult(w http.ResponseWriter, r *http.Request, result UpdateResult) error {
|
||||
var unresolvedRefErr UnresolvedRefError
|
||||
if result.outcome == UpdateError && errors.As(result.err, &unresolvedRefErr) {
|
||||
offeredContentTypes := []string{"application/vnd.git-pages.unresolved", "text/plain"}
|
||||
offeredContentTypes := []string{"text/plain", "application/vnd.git-pages.unresolved"}
|
||||
acceptedContentTypes := ParseAcceptHeader(r.Header.Get("Accept"))
|
||||
switch acceptedContentTypes.Negotiate(offeredContentTypes...) {
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user