Issue #143
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -3,4 +3,5 @@ tests/temp/
|
|||||||
.svn/
|
.svn/
|
||||||
*.swp
|
*.swp
|
||||||
*~
|
*~
|
||||||
|
*.scm
|
||||||
*#
|
*#
|
||||||
|
|||||||
@@ -43,6 +43,8 @@ feature -- Access
|
|||||||
http_accept_language: STRING = "HTTP_ACCEPT_LANGUAGE"
|
http_accept_language: STRING = "HTTP_ACCEPT_LANGUAGE"
|
||||||
|
|
||||||
http_connection: STRING = "HTTP_CONNECTION"
|
http_connection: STRING = "HTTP_CONNECTION"
|
||||||
|
|
||||||
|
http_content_range: STRING = "HTTP_CONTENT_RANGE"
|
||||||
|
|
||||||
http_expect: STRING = "HTTP_EXPECT"
|
http_expect: STRING = "HTTP_EXPECT"
|
||||||
|
|
||||||
|
|||||||
@@ -639,6 +639,11 @@ feature -- HTTP_*
|
|||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
|
http_content_range: detachable READABLE_STRING_8
|
||||||
|
-- Partial range of selected representation enclosed in message payload
|
||||||
|
deferred
|
||||||
|
end
|
||||||
|
|
||||||
feature -- Extra CGI environment variables
|
feature -- Extra CGI environment variables
|
||||||
|
|
||||||
request_uri: READABLE_STRING_8
|
request_uri: READABLE_STRING_8
|
||||||
|
|||||||
@@ -289,7 +289,13 @@ feature -- Access: HTTP_* CGI meta parameters - 1.1
|
|||||||
do
|
do
|
||||||
Result := meta_string_variable ({WGI_META_NAMES}.http_range)
|
Result := meta_string_variable ({WGI_META_NAMES}.http_range)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
http_content_range: detachable READABLE_STRING_8
|
||||||
|
-- Partial range of selected representation enclosed in message payload
|
||||||
|
do
|
||||||
|
Result := meta_string_variable ({WGI_META_NAMES}.http_content_range)
|
||||||
|
end
|
||||||
|
|
||||||
feature -- Access: Extension to CGI meta parameters - 1.1
|
feature -- Access: Extension to CGI meta parameters - 1.1
|
||||||
|
|
||||||
request_uri: READABLE_STRING_8
|
request_uri: READABLE_STRING_8
|
||||||
|
|||||||
@@ -464,7 +464,9 @@ feature -- Execution
|
|||||||
if req.is_request_method ({HTTP_REQUEST_METHODS}.method_options) then
|
if req.is_request_method ({HTTP_REQUEST_METHODS}.method_options) then
|
||||||
execute_options (req, res, router)
|
execute_options (req, res, router)
|
||||||
else
|
else
|
||||||
if attached new_method_helper (req.request_method) as l_helper then
|
if req.is_request_method ({HTTP_REQUEST_METHODS}.method_put) and attached req.http_content_range then
|
||||||
|
handle_invalid_content_range (res)
|
||||||
|
elseif attached new_method_helper (req.request_method) as l_helper then
|
||||||
execute_method (req, res, l_helper)
|
execute_method (req, res, l_helper)
|
||||||
else
|
else
|
||||||
handle_internal_server_error (res)
|
handle_internal_server_error (res)
|
||||||
@@ -515,7 +517,29 @@ feature -- Execution
|
|||||||
end
|
end
|
||||||
|
|
||||||
feature {NONE} -- Implementation
|
feature {NONE} -- Implementation
|
||||||
|
|
||||||
|
handle_invalid_content_range (res: WSF_RESPONSE)
|
||||||
|
-- Write "Bad Request" response to `res' for Content-Range header present in PUT request.
|
||||||
|
require
|
||||||
|
res_attached: res /= Void
|
||||||
|
local
|
||||||
|
h: HTTP_HEADER
|
||||||
|
m: STRING_8
|
||||||
|
do
|
||||||
|
create h.make
|
||||||
|
h.put_content_type_text_plain
|
||||||
|
m := "Content-Range header present in PUT request"
|
||||||
|
h.put_content_length (m.count)
|
||||||
|
h.put_current_date
|
||||||
|
res.set_status_code ({HTTP_STATUS_CODE}.bad_request)
|
||||||
|
res.put_header_lines (h)
|
||||||
|
res.put_string (m)
|
||||||
|
ensure
|
||||||
|
response_status_is_set: res.status_is_set
|
||||||
|
status_is_service_unavailable: res.status_code = {HTTP_STATUS_CODE}.internal_server_error
|
||||||
|
body_sent: res.message_committed and then res.transfered_content_length > 0
|
||||||
|
end
|
||||||
|
|
||||||
handle_internal_server_error (res: WSF_RESPONSE)
|
handle_internal_server_error (res: WSF_RESPONSE)
|
||||||
-- Write "Internal Server Error" response to `res'.
|
-- Write "Internal Server Error" response to `res'.
|
||||||
require
|
require
|
||||||
|
|||||||
@@ -1227,7 +1227,13 @@ feature -- HTTP_*
|
|||||||
do
|
do
|
||||||
Result := wgi_request.http_range
|
Result := wgi_request.http_range
|
||||||
end
|
end
|
||||||
|
|
||||||
|
http_content_range: detachable READABLE_STRING_8
|
||||||
|
-- Partial range of selected representation enclosed in message payload
|
||||||
|
do
|
||||||
|
Result := wgi_request.http_content_range
|
||||||
|
end
|
||||||
|
|
||||||
feature -- Extra CGI environment variables
|
feature -- Extra CGI environment variables
|
||||||
|
|
||||||
request_uri: READABLE_STRING_8
|
request_uri: READABLE_STRING_8
|
||||||
|
|||||||
Reference in New Issue
Block a user