diff options
-rw-r--r-- | src/reqs.c | 14 | ||||
-rw-r--r-- | src/reverse-proxy.c | 8 |
2 files changed, 11 insertions, 11 deletions
@@ -369,12 +369,18 @@ BAD_REQUEST_ERROR: reverse_url = reverse_rewrite_url (connptr, hashofheaders, url); - if (!reverse_url) { + if (reverse_url != NULL) { + safefree (url); + url = reverse_url; + } else if (config.reverseonly) { + log_message (LOG_ERR, + "Bad request, no mapping for '%s' found", + url); + indicate_http_error (connptr, 400, "Bad Request", + "detail", "No mapping found for " + "requested url", "url", url, NULL); goto fail; } - - safefree (url); - url = reverse_url; } #endif diff --git a/src/reverse-proxy.c b/src/reverse-proxy.c index 9ca55f6..0264787 100644 --- a/src/reverse-proxy.c +++ b/src/reverse-proxy.c @@ -156,13 +156,7 @@ char *reverse_rewrite_url (struct conn_s *connptr, hashmap_t hashofheaders, } } - /* Forward proxy support off and no reverse path match found */ - if (config.reverseonly && !rewrite_url) { - log_message (LOG_ERR, "Bad request"); - indicate_http_error (connptr, 400, "Bad Request", - "detail", - "Request has an invalid URL", "url", url, - NULL); + if (rewrite_url == NULL) { return NULL; } |