|
|
|
@ -216,9 +216,15 @@ handler_t http_response_prepare(server *srv, connection *con) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
buffer_copy_string_buffer(srv->tmp_buf, con->uri.path_raw);
|
|
|
|
|
buffer_urldecode_path(srv->tmp_buf);
|
|
|
|
|
buffer_path_simplify(con->uri.path, srv->tmp_buf);
|
|
|
|
|
if (con->request.http_method == HTTP_METHOD_OPTIONS &&
|
|
|
|
|
con->uri.path_raw->ptr[0] == '*' && con->uri.path_raw->ptr[1] == '\0') {
|
|
|
|
|
/* OPTIONS * ... */
|
|
|
|
|
buffer_copy_string_buffer(con->uri.path, con->uri.path_raw);
|
|
|
|
|
} else {
|
|
|
|
|
buffer_copy_string_buffer(srv->tmp_buf, con->uri.path_raw);
|
|
|
|
|
buffer_urldecode_path(srv->tmp_buf);
|
|
|
|
|
buffer_path_simplify(con->uri.path, srv->tmp_buf);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (con->conf.log_request_handling) {
|
|
|
|
|
log_error_write(srv, __FILE__, __LINE__, "s", "-- sanatising URI");
|
|
|
|
@ -249,7 +255,7 @@ handler_t http_response_prepare(server *srv, connection *con) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (con->request.http_method == HTTP_METHOD_OPTIONS &&
|
|
|
|
|
con->uri.path->ptr[0] == '*') {
|
|
|
|
|
con->uri.path->ptr[0] == '*' && con->uri.path_raw->ptr[1] == '\0') {
|
|
|
|
|
/* option requests are handled directly without checking of the path */
|
|
|
|
|
|
|
|
|
|
response_header_insert(srv, con, CONST_STR_LEN("Allow"), CONST_STR_LEN("OPTIONS, GET, HEAD, POST"));
|
|
|
|
|