Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Behaviour when incoming request method is HEAD?

Open
#296 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Active
Tech stack
typescript
Domain
api

Research direction

Start with the +handler.ts endpoint using Run.GET and reproduce the difference between GET and HEAD, focusing on the shape of ctx.search. Determine the intended behavior when only a GET handler exists, then verify that HEAD follows that decision without crashing; the issue is done when the behavior is specified and the reported failure is covered.

Written by the indexing model from the issue text.

Description

I originally wanted to submit this as a bug report:

Given I have a +handler.ts with only export const GET = Run.GET({ search: ...}, (ctx) => { ... }).
When I hit the endpoint with HTTP GET
Then the handler executes correctly. Importantly, ctx.search is a tuple and destructuring it works.

But,
When I hit the same endpoint with HTTP HEAD
The handler executes, but crash because ctx.search is not a tuple in this case.

The more I think about it though, I started wondering what the correct behavior should be, when GET handler is defined but HEAD handler is not, and an incoming request method is HEAD?

  • return 404 if GET handler is defined, but HEAD handler is not?
  • process the GET handler, including rendering the body, but returning only the HEAD content - this is to avoid issues like unhandled exceptions in promises generated by the GET handler or any outer middleware? This seems wasteful, but is safe.
Dominant language
TypeScript
Stars
175
Forks
16
Avg merge
3d 12h
Merged PRs (30d)
6

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from marko-js/run

All issues in marko-js/run

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.