• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

RobinTail / express-zod-api / 16398948654 / 1
100%
master: 100%

Build:
DEFAULT BRANCH: master
Ran 20 Jul 2025 10:35AM UTC
Files 52
Run time 3s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

20 Jul 2025 10:33AM UTC coverage: 100.0%. Remained the same
16398948654.1

push

github

web-flow
feat: `HEAD` method handling (#2816)

Based on #2791 

- MDN:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/HEAD
- RFC: https://httpwg.org/specs/rfc9110.html#HEAD

> MUST NOT send content in the response

Findings in Express:

- no need to set `app.head()` handler, it's automatically set for all
`app.get()` ones:
  - https://expressjs.com/en/api.html#app.METHOD
- No extra handling required for `res.send()` — it automatically sends
`Content-Length` header instead of response body for requests having
`HEAD` method:
  - https://expressjs.com/en/api.html#res.send
- For streams, `Content-Length` should not be set anyway because of
`Transfer-encoding: chunked`, according to RFC:
  - https://datatracker.ietf.org/doc/html/rfc7230#section-3.3.2
  - https://github.com/expressjs/express/issues/2893
- > A sender MUST NOT send a Content-Length header field in any message
that contains a Transfer-Encoding header field.
- HOWEVER, for `HEAD` it SHOULD be there: 
- The relevant nuance is described in [RFC 9110, Section 9.3.2.
HEAD(https://datatracker.ietf.org/doc/html/rfc9110#section-9.3.2):
- > The server SHOULD send the same header fields in response to a HEAD
request as it would have sent if the request had been a GET, except that
the payload header fields (Section 6.4) MAY be omitted. This includes
sending headers such as Content-Length, even though there is no response
body.
- And in [RFC 9110, Section 6.4.1.
Content-Length](https://datatracker.ietf.org/doc/html/rfc9110#section-6.4.1):
- > A server MAY send a Content-Length header field in a response to a
HEAD request (Section 9.3.2; see also Section 9.3.6), indicating the
size of the payload body that would have been sent had the request been
a GET.
- This means that even if a GET response would use chunked encoding and
omit Content-Length, the HEAD response can and should include
Content-Length if the size is known.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-... (continued)

1172 of 1212 branches covered (96.7%)

4021 of 4021 relevant lines covered (100.0%)

66.4 hits per line

Source Files on job run-22.0.0 - 16398948654.1
  • Tree
  • List 52
  • Changed 10
  • Source Changed 10
  • Coverage Changed 9
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 16398948654
  • b1762bf4 on github
  • Prev Job for on master (#16387530738.5)
  • Next Job for on master (#16399354057.4)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc