Every route answers HEAD where upstream answers 405 #136
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
axum's
get()serves HEAD implicitly; ASP.NET serves it only where[HttpHead]is declared. So this server answers HEAD on routes upstream refuses as a method, port-wide.Measured while closing #131:
#131 fixed the four inside
crates/jellyfin-http/src/routes/streaming/hls.rsby declaring the methods each action actually has, which is the right shape for one module and the wrong shape for 253 registrations.Where to start
The list of upstream's
[HttpHead]declarations is the input, and it is derivable rather than transcribable:xtask endpointsalready scans upstream's controllers to generateENDPOINTS.md, so extending that scanner to record which actions declare[HttpHead]gives the answer key. Then the router declares GET-only where upstream does.ENDPOINTS.mdalready counts HEAD operations separately — it lists 37 image routes withGETandHEADas distinct rows — so the generated inventory is the natural place for this to be checked rather than remembered.Two details worth carrying, both from #131's measurements:
Allow: GET, HEADwith a space; ours writesAllow: GET,HEAD.How to know it is done
A HEAD to every route this server declares answers what upstream answers — which is a comparison
xtask endpointscan make once it knows upstream's declarations, andrefusals.jsonis where a handful of representative ones belong so a replay holds it.