Canonicalize HTTP method in ScgiRequest.
authorFredrik Tolf <fredrik@dolda2000.com>
Sat, 11 Sep 2010 04:02:28 +0000 (06:02 +0200)
committerFredrik Tolf <fredrik@dolda2000.com>
Sat, 11 Sep 2010 04:02:28 +0000 (06:02 +0200)
src/dolda/jsvc/scgi/ScgiRequest.java

index 192d380..a7931ed 100644 (file)
@@ -55,9 +55,12 @@ public class ScgiRequest extends ResponseBuffer {
        path = environ.get("PATH_INFO");
        if(path == null)
            throw(new InvalidRequestException("Missing PATH_INFO"));
-       method = environ.get("REQUEST_METHOD");
-       if(method == null)
-           throw(new InvalidRequestException("Missing REQUEST_METHOD"));
+       {
+           String tmp = environ.get("REQUEST_METHOD");
+           if(tmp == null)
+               throw(new InvalidRequestException("Missing REQUEST_METHOD"));
+           method = tmp.toUpperCase().intern();
+       }
        {
            /* Ewwww, this is disgusting! */
            String scheme = "http";