Skip to content
This repository has been archived by the owner on Jul 13, 2021. It is now read-only.

Wrong http status code for forbidden tunnels #69

Closed
dmj opened this issue Oct 18, 2015 · 1 comment
Closed

Wrong http status code for forbidden tunnels #69

dmj opened this issue Oct 18, 2015 · 1 comment

Comments

@dmj
Copy link

dmj commented Oct 18, 2015

The status code is 404 but should rather be 403.

diff --git a/tunnel.c b/tunnel.c
index e1e1e62..9efb656 100644
--- a/tunnel.c
+++ b/tunnel.c
@@ -174,7 +174,7 @@ do_tunnel(int fd, char *buf, int offset, int len, AtomPtr url)
     if (tunnelIsMatched(url->string, url->length, 
            tunnel->hostname->string, tunnel->hostname->length)) {
         releaseAtom(url);
-        tunnelError(tunnel, 404, internAtom("Forbidden tunnel"));
+        tunnelError(tunnel, 403, internAtom("Forbidden tunnel"));
    logTunnel(tunnel,1);
         return;
     }
@jech
Copy link
Owner

jech commented Dec 7, 2015

Fixed in 882029b, thanks.

@jech jech closed this as completed Dec 7, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants