Skip to content

Commit

Permalink
web: Don't redirect to localhost as well as from
Browse files Browse the repository at this point in the history
  • Loading branch information
CyberShadow committed Oct 11, 2016
1 parent b649b6d commit c10a7c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web.d
Expand Up @@ -197,7 +197,7 @@ HttpResponse handleRequest(HttpRequest request, HttpServerConnection conn)
// Redirect to canonical domain name
auto host = request.headers.get("Host", "");
host = request.headers.get("X-Forwarded-Host", host);
if (host != vhost && host != "localhost" && ip != "127.0.0.1" && !request.resource.startsWith("/.well-known/acme-challenge/"))
if (host != vhost && host != "localhost" && vhost != "localhost" && ip != "127.0.0.1" && !request.resource.startsWith("/.well-known/acme-challenge/"))
return response.redirect("http://" ~ vhost ~ request.resource, HttpStatusCode.MovedPermanently);

auto canonicalHeader =
Expand Down

0 comments on commit c10a7c9

Please sign in to comment.