move processing of Upload-Metadata: to the right place

parent 53d84a0f
......@@ -232,14 +232,6 @@ tus_request(VRT_CTX, struct VPFX(tus_server) *tussrv,
http_Unset(ctx->http_req, hdr_method);
}
if (http_GetHdr(ctx->http_req, hdr_meta, &metadata) &&
tus_metadata_validate(metadata, NULL) == 0) {
VSLb(ctx->vsl, SLT_Error, "%s: bad metadata format",
tus_server_name(tussrv));
r->status = 400;
return (0);
}
m = parse_met(http_GetMethod(ctx->http_req));
(void) http_GetHdr(ctx->http_req, hdr_origin, &r->origin);
......@@ -280,6 +272,14 @@ tus_request(VRT_CTX, struct VPFX(tus_server) *tussrv,
}
}
if (http_GetHdr(ctx->http_req, hdr_meta, &metadata) &&
tus_metadata_validate(metadata, NULL) == 0) {
VSLb(ctx->vsl, SLT_Error, "%s: bad metadata format",
tus_server_name(tussrv));
r->status = 400;
return (0);
}
AZ(pthread_mutex_lock(&tussrv->mtx));
if (m == POST) {
......
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