mirror of
https://codeberg.org/git-pages/git-pages.git
synced 2026-08-29 04:07:12 +00:00
Allow supplying Authorization: via query parameter.
There is no other way to authorize GitHub and Gogs webhook payloads.
This commit is contained in:
@@ -174,6 +174,13 @@ func postPage(w http.ResponseWriter, r *http.Request) error {
|
||||
}
|
||||
allowRepoURL = fmt.Sprintf(config.Wildcard.CloneURL, userName, repoName)
|
||||
} else {
|
||||
// GitHub and Gogs cannot supply an `Authorization:` header.
|
||||
if r.Header.Get("Authorization") == "" {
|
||||
if value := r.URL.Query().Get("Authorization"); value != "" {
|
||||
r.Header.Set("Authorization", value)
|
||||
}
|
||||
}
|
||||
|
||||
if err := Authorize(w, r); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user