From 54517b54405027752ccedf83eab8a62acce83d8c Mon Sep 17 00:00:00 2001 From: Stephan Leemburg Date: Sat, 10 Sep 2016 18:50:33 +0200 Subject: [PATCH] leave the logic to the caller --- src/reverse-proxy.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/reverse-proxy.c b/src/reverse-proxy.c index b2e2db1..0264787 100644 --- a/src/reverse-proxy.c +++ b/src/reverse-proxy.c @@ -156,18 +156,11 @@ 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; } - log_message (LOG_CONN, "Rewriting URL: %s -> %s", url, - rewrite_url ? rewrite_url : "No mapping found"); + log_message (LOG_CONN, "Rewriting URL: %s -> %s", url, rewrite_url); /* Store reverse path so that the magical tracking cookie can be set */ if (config.reversemagic && reverse)