Skip to content

Commit

Permalink
wasnt setting the header vars properly
Browse files Browse the repository at this point in the history
  • Loading branch information
schacon committed Apr 10, 2010
1 parent 7638417 commit 66d35ee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kidgloves.rb
Expand Up @@ -82,13 +82,14 @@ def listen
line.strip!
break if line.size == 0
key, val = line.split(": ")
key = key.upcase.gsub('-', '_')
req[key] = val
end

# parse the body
body = ''
if (len = req['Content-Length']) && ["POST", "PUT"].member?(method)
body = socket.read(len)
if (len = req['CONTENT_LENGTH']) && ["POST", "PUT"].member?(method)
body = socket.read(len.to_i)
end

# process the request
Expand All @@ -113,7 +114,6 @@ def process_request(request, input_body, socket)
env.delete "HTTP_CONTENT_TYPE"
env.delete "HTTP_CONTENT_LENGTH"
env["HTTP_VERSION"] ||= env["SERVER_PROTOCOL"]
env["PATH_INFO"] = env["REQUEST_PATH"]
env["QUERY_STRING"] ||= ""
env["SCRIPT_NAME"] = ""

Expand Down

0 comments on commit 66d35ee

Please sign in to comment.