All problems

Artifact HEAD Response Still Sends the GET Body

Level 2 · node · API · HTTP HEAD response contract error

Scenario

A build artifact service serves file content with GET and lets clients inspect download metadata with HEAD on the same path. Monitoring now shows HEAD traffic consuming the same bytes as GET, and metadata checks for large artifacts return the full payload size as an actual response body. The repository and response builder are correct; the controller assembles the response based on the HTTP method.

Requirements

- GET must continue returning the artifact body - HEAD must return the same status and Content-Length metadata as GET but with an empty body - Missing artifacts must return 404 for both GET and HEAD - A HEAD 404 must also send no body - Content-Length must continue to represent the actual artifact byte length

Acceptance criteria

  • A successful GET includes the original artifact body
  • A successful HEAD has an empty body and the same Content-Length as GET
  • Content-Length for a UTF-8 artifact matches its byte length
  • GET for a missing artifact returns 404
  • HEAD for a missing artifact returns 404 with an empty body