lib/net/http/server/requests.rb in net-http-server-0.2.0 vs lib/net/http/server/requests.rb in net-http-server-0.2.1
- old
+ new
@@ -63,24 +63,19 @@
# The unnormalized HTTP request.
#
def normalize_uri(request)
uri = request[:uri]
- if uri.kind_of?(Hash)
+ case uri
+ when Hash
if uri[:scheme]
uri[:port] = unless uri[:port]
DEFAULT_PORTS[uri[:scheme]]
else
uri[:port].to_i
end
end
-
- unless uri[:path]
- uri[:path] = '/'
- else
- uri[:path].insert(0,'/')
- end
- elsif uri == '*'
+ when '*'
request[:uri] = {}
end
end
#