Skip to content

Commit

Permalink
Merge pull request #29 from Geod24/mlang/Cleanup
Browse files Browse the repository at this point in the history
Remove trailing whitespace
  • Loading branch information
s-ludwig authored Feb 20, 2024
2 parents 7104bbf + b928408 commit 6c9e346
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/vibe/http/server.d
Original file line number Diff line number Diff line change
Expand Up @@ -2289,7 +2289,7 @@ private bool handleRequest(Allocator)(InterfaceProxy!Stream http_stream, TCPConn
if (context.settings.rejectConnectionPredicate !is null)
{
import std.socket : Address, parseAddress;

auto forward = req.headers.get("X-Forwarded-For", null);
if (forward !is null)
{
Expand All @@ -2298,7 +2298,7 @@ private bool handleRequest(Allocator)(InterfaceProxy!Stream http_stream, TCPConn
if (ix != -1)
forward = forward[0 .. ix];
if (context.settings.rejectConnectionPredicate(NetworkAddress(parseAddress(forward))))
errorOut(HTTPStatus.forbidden,
errorOut(HTTPStatus.forbidden,
httpStatusText(HTTPStatus.forbidden), null, null);
} catch (Exception e)
logTrace("Malformed X-Forwarded-For header: %s", e.msg);
Expand Down

0 comments on commit 6c9e346

Please sign in to comment.