1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
mneumann 2004-11-16 13:35:45 +00:00
parent f5c2af51db
commit 790a05a3b9

View file

@ -792,27 +792,27 @@ class WEBrickServlet < BasicServer
def service(request, response)
if request.request_method != "POST"
raise HTTPStatus::MethodNotAllowed,
raise WEBrick::HTTPStatus::MethodNotAllowed,
"unsupported method `#{request.request_method}'."
end
if parse_content_type(request['Content-type']).first != "text/xml"
raise HTTPStatus::BadRequest
raise WEBrick::HTTPStatus::BadRequest
end
length = (request['Content-length'] || 0).to_i
raise HTTPStatus::LengthRequired unless length > 0
raise WEBrick::HTTPStatus::LengthRequired unless length > 0
data = request.body
if data.nil? or data.size != length
raise HTTPStatus::BadRequest
raise WEBrick::HTTPStatus::BadRequest
end
resp = process(data)
if resp.nil? or resp.size <= 0
raise HTTPStatus::InternalServerError
raise WEBrick::HTTPStatus::InternalServerError
end
response.status = 200