Return reason in error responses

parent 658a0eee
...@@ -53,4 +53,6 @@ const char * const hdr_aceh = "\036Access-Control-Expose-Headers:"; ...@@ -53,4 +53,6 @@ const char * const hdr_aceh = "\036Access-Control-Expose-Headers:";
const char * const hdr_allow = "\006Allow:"; const char * const hdr_allow = "\006Allow:";
const char * const hdr_reason = "\007Reason:";
const char * const hdr_vtc = "\015VTC-Filename:"; const char * const hdr_vtc = "\015VTC-Filename:";
...@@ -51,4 +51,6 @@ extern const char * const hdr_aceh; ...@@ -51,4 +51,6 @@ extern const char * const hdr_aceh;
extern const char * const hdr_allow; extern const char * const hdr_allow;
extern const char * const hdr_reason;
extern const char * const hdr_vtc; extern const char * const hdr_vtc;
...@@ -139,6 +139,11 @@ tus_response(VRT_CTX, const struct VPFX(tus_server) *tussrv, ...@@ -139,6 +139,11 @@ tus_response(VRT_CTX, const struct VPFX(tus_server) *tussrv,
return; return;
} }
VRT_l_resp_status(ctx, resp->s.status); VRT_l_resp_status(ctx, resp->s.status);
if (resp->s.reason != NULL) {
VRT_l_resp_reason(ctx, resp->s.reason, vrt_null_strands);
// FCK H2 - stupid idea to eliminate the reason
http_ForceHeader(r, hdr_reason, resp->s.reason);
}
if (resp->s.status == 405) { if (resp->s.status == 405) {
http_ForceHeader(r, hdr_allow, allow); http_ForceHeader(r, hdr_allow, allow);
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment