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