diff options
| author | Xavier Del Campo Romero <xavi92@disroot.org> | 2026-09-27 22:11:04 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi92@disroot.org> | 2026-09-27 22:11:04 +0200 |
| commit | 284551675d7596c6de9edbf488701395823e1d3c (patch) | |
| tree | ac09ed3af128961d58d2ca3ed7aaacfef99919f3 | |
| parent | e8e9b1b129bc9a324e9df4a98d971505a2739a85 (diff) | |
| download | libweb-284551675d7596c6de9edbf488701395823e1d3c.tar.gz | |
Whereas libweb does support returning partial transfers [1], it only
does so limited to file transfers because it can be difficult or
impossible to perform a partial request for what can be otherwise
dynamically generated content.
Previously, libweb naively accepted any range request from the client
and silently replaced the response status to "206 Partial Content". [2]
However, if no FILE * had been specified by the application,
adjust_partial would treat this as a fatal error, because libweb assumed
this as a programming error by the application.
[1]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Range_requests
[2]: https://en.wikipedia.org/wiki/HTTP_status#2xx_success
| -rw-r--r-- | http.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1693,7 +1693,7 @@ static int process_get(struct http_ctx *const h) w->op = c->op; ctx_free(c); - if (w->gr.state) + if (w->gr.state && r->f) w->r.status = HTTP_STATUS_PARTIAL_CONTENT; return start_response(h); |
