Skip to content

Support HEAD requests on the welcome page - #1166

Open
nerdeveloper wants to merge 1 commit into
helm:mainfrom
nerdeveloper:fix/head-root
Open

nerdeveloper wants to merge 1 commit into
helm:mainfrom
nerdeveloper:fix/head-root

Conversation

@nerdeveloper

Copy link
Copy Markdown
Member

Summary

ChartMuseum returned 404 for HEAD / even when GET / served the welcome page. Clients can now check the home page without downloading it.

  • Use the same handler and read permission for HEAD / and GET /.
  • Close the template directory after checking it so repeated requests release the file handle.
  • Document the endpoint and add an HTTP regression test for the default page, a custom page, and Basic Auth.

Related report: deliveryhero/helm-charts#186

Verification

  • Reproduced 404 before the change. The regression test now verifies 200 with an empty body and the same content type as GET, and 401 with the same authentication challenge when credentials are missing.
  • make test and go vet ./... passed. GolangCI-Lint reported zero issues in the diff using a temporary migrated configuration.
  • A test with a low open-file limit passed 160 custom-page iterations after the directory cleanup.

Signed-off-by: Obinna Odirionye <odirionye@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant