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:
5
.gitmodules
vendored
5
.gitmodules
vendored
@@ -11,8 +11,3 @@
|
|||||||
path = ext/ise_library/curl
|
path = ext/ise_library/curl
|
||||||
url = http://github.com/EiffelSoftware/mirror-Eiffel-cURL.git
|
url = http://github.com/EiffelSoftware/mirror-Eiffel-cURL.git
|
||||||
[submodule "ext/crypto/eel"]
|
[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
|
|
||||||
|
|||||||
@@ -181,7 +181,8 @@ feature -- HTTP Methods
|
|||||||
-- Here we use DELETE to cancel an order, if that order is in state where
|
-- Here we use DELETE to cancel an order, if that order is in state where
|
||||||
-- it can still be canceled.
|
-- it can still be canceled.
|
||||||
-- 200 if is ok
|
-- 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
|
-- 500 if we have an internal server error
|
||||||
local
|
local
|
||||||
id: STRING
|
id: STRING
|
||||||
@@ -194,7 +195,7 @@ feature -- HTTP Methods
|
|||||||
compute_response_delete (ctx, req, res)
|
compute_response_delete (ctx, req, res)
|
||||||
else
|
else
|
||||||
--| FIXME: Here we need to define the Allow methods
|
--| 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
|
end
|
||||||
else
|
else
|
||||||
handle_resource_not_found_response (orig_path + " not found in this server", ctx, req, res)
|
handle_resource_not_found_response (orig_path + " not found in this server", ctx, req, res)
|
||||||
|
|||||||
@@ -239,6 +239,23 @@ feature -- Handle responses
|
|||||||
res.write_string (a_description)
|
res.write_string (a_description)
|
||||||
end
|
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)
|
handle_resource_not_found_response (a_description:STRING; ctx: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
|
||||||
local
|
local
|
||||||
h : EWF_HEADER
|
h : EWF_HEADER
|
||||||
|
|||||||
Reference in New Issue
Block a user