Skip to content

Conversation

@MadLittleMods
Copy link
Collaborator

@MadLittleMods MadLittleMods commented Dec 20, 2025

Fix homerunner CORS. Noticed while trying to use the homerunner API from a browser based tool.

Testing strategy

  1. go run ./cmd/homerunner
  2. Fetch http://localhost:54321/health from another page in the browser (I'm using a local version of Hoppscotch)

Pull Request Checklist

))),
)
mux.Path("/destroy").Methods("POST").HandlerFunc(
util.WithCORSOptions(util.MakeJSONAPI(util.NewJSONRequestHandler(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously, this was using matrix-org/util -> WithCORSOptions which only added the CORS headers to OPTIONS requests.

But we a) never accepted the OPTIONS method here and b) the CORS headers should also be on the non-OPTIONS requests.

@MadLittleMods MadLittleMods marked this pull request as ready for review December 20, 2025 00:53
@MadLittleMods MadLittleMods requested review from a team and kegsay as code owners December 20, 2025 00:53
Copy link
Contributor

@devonh devonh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice little cleanup. Thanks for this.

@MadLittleMods MadLittleMods merged commit 9ad96b4 into main Dec 22, 2025
4 checks passed
@MadLittleMods MadLittleMods deleted the madlittlemods/fix-homerunner-cors branch December 22, 2025 15:50
@MadLittleMods
Copy link
Collaborator Author

Thanks for the review @devonh 🐫

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants