mirror of
https://codeberg.org/git-pages/git-pages.git
synced 2026-05-22 23:21:45 +00:00
Use Branch: instead of X-Pages-Branch: to set custom branch name.
This commit is contained in:
@@ -60,7 +60,7 @@ Features
|
||||
- Site paths starting with `.git-pages/...` are reserved.
|
||||
- The `.git-pages/manifest.json` path returns a [ProtoJSON](https://protobuf.dev/programming-guides/json/) representation of the deployed site manifest. It enumerates site structure, redirect rules, and errors that were not severe enough to abort publishing.
|
||||
* In response to a `PUT` or `POST` request, the server retrieves updates a site with new content. The URL of the request must be the root URL of the site that is being published.
|
||||
- If the `PUT` method receives an `application/x-www-form-urlencoded` body, it contains a repository URL to be shallowly cloned. The `X-Pages-Branch` header contains the branch to be checked out; the `pages` branch is used if the header is absent.
|
||||
- If the `PUT` method receives an `application/x-www-form-urlencoded` body, it contains a repository URL to be shallowly cloned. The `Branch` header contains the branch to be checked out; the `pages` branch is used if the header is absent.
|
||||
- If the `PUT` method receives an `application/x-tar`, `application/x-tar+gzip`, `application/x-tar+zstd`, or `application/zip` body, it contains an archive to be extracted.
|
||||
- The `POST` method requires an `application/json` body containing a Forgejo/Gitea/Gogs/GitHub webhook event payload. Requests where the `ref` key contains anything other than `refs/heads/pages` are ignored, and only the `pages` branch is used. The `repository.clone_url` key contains a repository URL to be shallowly cloned.
|
||||
- If the received contents is empty, performs the same action as `DELETE`.
|
||||
|
||||
@@ -365,7 +365,7 @@ func putPage(w http.ResponseWriter, r *http.Request) error {
|
||||
}
|
||||
|
||||
branch := "pages"
|
||||
if customBranch := r.Header.Get("X-Pages-Branch"); customBranch != "" {
|
||||
if customBranch := r.Header.Get("Branch"); customBranch != "" {
|
||||
branch = customBranch
|
||||
}
|
||||
if err := AuthorizeBranch(branch, auth); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user