Permalink
Browse files

Use "403 Forbidden" instead of "400 Bad Request".

Per RFC2616:

10.4.1 400 Bad Request
The request could not be understood by the server due to malformed
syntax.

10.4.4 403 Forbidden
The server understood the request, but is refusing to fulfill it.
Authorization will not help and the request SHOULD NOT be repeated.

Change-Id: Idb6ea7fa49c61bd9e6cc6067afdae57c7c81817b
Signed-off-by: Piotr Sikora <piotr.sikora@frickle.com>
  • Loading branch information...
PiotrSikora committed Jan 22, 2012
1 parent 02b4f28 commit 65379bbfb4ed56429ccd5d36224915af0537877e
Showing with 3 additions and 3 deletions.
  1. +1 −1 README.md
  2. +1 −1 static/index.html
  3. +1 −1 turk/turk.go
View
@@ -18,7 +18,7 @@ Verifies if the provided URL is allowed to be crawled by your User-Agent. Pass i
< Location: http://www.google.com/
### $ curl -v http://canicrawl.appspot.com/check?url=http://google.com/search
- < HTTP/1.0 400 Bad Request
+ < HTTP/1.0 403 Forbidden
< Content-Length: 23
{"status":"disallowed"}
View
@@ -79,7 +79,7 @@ <h3 id="-curl-v-http-canicrawl-appspot-com-check-url-http-www-google-com-">$ cur
<h3 id="-curl-v-http-canicrawl-appspot-com-check-url-http-www-google-com-search">$ curl -v http://canicrawl.appspot.com/check?url=http://google.com/search</h3>
-<pre><code>&lt; HTTP/1.0 400 Bad Request
+<pre><code>&lt; HTTP/1.0 403 Forbidden
&lt; Content-Length: 23
{"status":"disallowed"}
</code></pre>
View
@@ -70,7 +70,7 @@ func handler(w http.ResponseWriter, r *http.Request) {
}
resp, _ := json.Marshal(reply)
- w.WriteHeader(400)
+ w.WriteHeader(http.StatusForbidden)
w.Write(resp)
return
}

0 comments on commit 65379bb

Please sign in to comment.