Ian Whyman's suggestion in github
@@ -1179,6 +1179,10 @@ static int process_request(
}
if (using_virtual_dir) {
if (req->method != HTTPMETHOD_POST) {
+ if ((code = ExtraHTTPHeaders(req, extra_headers)) != HTTP_OK) {
+ err_code = code;
+ goto error_handler;
+ }
/* get file info */
if (virtualDirCallback.
get_info(filename->buf, finfo, RespInstr->Cookie) != 0) {
@@ -1281,9 +1285,6 @@ static int process_request(
err_code = HTTP_OK;
goto error_handler;
}
- /* TODO: Check that cast that removes const. */
- /*extra_headers = (struct list_head *)UpnpFileInfo_get_ExtraHeadersList(finfo);*/
- extra_headers = UpnpFileInfo_get_ExtraHeadersList(finfo);
/* Check if chunked encoding should be used. */
if (using_virtual_dir && UpnpFileInfo_get_FileLength(finfo) == UPNP_USING_CHUNKED) {
