From 3b6e6d4b415f97a8d3213801d9ce1bda6469a294 Mon Sep 17 00:00:00 2001 From: Stephan Leemburg Date: Sat, 10 Sep 2016 18:10:32 +0200 Subject: [PATCH] allow non-reverse mappings if reverseonly is not enabled --- src/reqs.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/reqs.c b/src/reqs.c index 86e1487..555c8c7 100644 --- a/src/reqs.c +++ b/src/reqs.c @@ -369,14 +369,14 @@ BAD_REQUEST_ERROR: reverse_url = reverse_rewrite_url (connptr, hashofheaders, url); - if (!reverse_url && config.reverseonly) { - goto fail; - } - - /* if not reverse only and a mapping was found.. */ - if(reverse_url) { + if (reverse_url != NULL) { safefree (url); url = reverse_url; + } else if (config.reverseonly) { + indicate_http_error (connptr, 400, "Bad Request", + "detail", "No mapping found for requested url", + "url", url, NULL); + goto fail; } } #endif