Update delete method to hanlde method not allowed.

Added method not allowed to request resource handler helper class.
Update gitmodules
This commit is contained in:
jvelilla
2011-10-23 09:05:12 -03:00
parent 9f53287226
commit 6344f964fa
3 changed files with 20 additions and 7 deletions

5
.gitmodules vendored
View File

@@ -11,8 +11,3 @@
path = ext/ise_library/curl
url = http://github.com/EiffelSoftware/mirror-Eiffel-cURL.git
[submodule "ext/crypto/eel"]
path = ext/crypto/eel
url = http://github.com/Eiffel-World/eel.git
[submodule "ext/crypto/eapml"]
path = ext/crypto/eapml
url = http://github.com/Eiffel-World/eapml.git

View File

@@ -181,7 +181,8 @@ feature -- HTTP Methods
-- Here we use DELETE to cancel an order, if that order is in state where
-- it can still be canceled.
-- 200 if is ok
-- 409 if consumer and service's view of the resouce state is inconsisent
-- 404 Resource not found
-- 405 if consumer and service's view of the resouce state is inconsisent
-- 500 if we have an internal server error
local
id: STRING
@@ -194,7 +195,7 @@ feature -- HTTP Methods
compute_response_delete (ctx, req, res)
else
--| FIXME: Here we need to define the Allow methods
handle_resource_conflict_response (orig_path + "%N There is conflict while trying to delete the order, the order could not be deleted in the current state", ctx, req, res)
handle_method_not_allowed_response (orig_path + "%N There is conflict while trying to delete the order, the order could not be deleted in the current state", ctx, req, res)
end
else
handle_resource_not_found_response (orig_path + " not found in this server", ctx, req, res)

View File

@@ -239,6 +239,23 @@ feature -- Handle responses
res.write_string (a_description)
end
handle_method_not_allowed_response (a_description:STRING; ctx: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER )
local
h : EWF_HEADER
do
create h.make
h.put_status ({HTTP_STATUS_CODE}.method_not_allowed)
if attached ctx.request_content_type (supported_content_types) as l_content_type then
h.put_content_type (l_content_type)
else
h.put_content_type ("*/*")
end
h.put_content_length (a_description.count)
h.put_current_date
res.set_status_code ({HTTP_STATUS_CODE}.method_not_allowed)
res.write_headers_string (h.string)
res.write_string (a_description)
end
handle_resource_not_found_response (a_description:STRING; ctx: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
local
h : EWF_HEADER