Skip to content

Conversation

@dav-wolff
Copy link
Contributor

Description

Fixes the HTTP HEAD method not working for paths that are handled by ApiService.ssr.

The HEAD method is supposed to return the same metadata as a GET request but without the body (https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/HEAD).
Previously this didn't happen because the ApiService.ssr checked if the method is GET and otherwise forwards the request to the api handlers which would result in a 404. Now ApiService.ssr also checks if the method is HEAD and handles the request. The html is still passed to res.send so that express can determine the proper Content-Length.

How Has This Been Tested?

I manually tested the status and headers (besides Date) being the same for GET and HEAD requests. I didn't write a unit test as ApiService, unlike all the other services, doesn't have a spec file and isn't able to use newTestService because it doesn't extend BaseService.
I also ran pnpm test and it didn't show any regressions.

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if applicable
  • I have no unrelated changes in the PR.
  • I have confirmed that any new dependencies are strictly necessary.
  • I have written tests for new code (if applicable)
  • I have followed naming conventions/patterns in the surrounding code
  • All code in src/services/ uses repositories implementations for database calls, filesystem operations, etc.
  • All code in src/repositories/ is pretty basic/simple and does not have any immich specific logic (that belongs in src/services/)

Please describe to which degree, if any, an LLM was used in creating this pull request.

No AI used.

@jrasm91 jrasm91 merged commit 0b3633d into immich-app:main Nov 11, 2025
54 of 56 checks passed
This was referenced Nov 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants