Applied renaming from write_ to put_
This commit is contained in:
@@ -158,8 +158,8 @@ feature -- Output
|
|||||||
send (buf: WSF_RESPONSE)
|
send (buf: WSF_RESPONSE)
|
||||||
do
|
do
|
||||||
buf.set_status_code (200)
|
buf.set_status_code (200)
|
||||||
buf.write_header_text (header_string)
|
buf.put_header_text (header_string)
|
||||||
buf.write_string (message_string)
|
buf.put_string (message_string)
|
||||||
end
|
end
|
||||||
|
|
||||||
feature {NONE} -- Implementation: output
|
feature {NONE} -- Implementation: output
|
||||||
|
|||||||
@@ -133,9 +133,9 @@ feature -- Output
|
|||||||
do
|
do
|
||||||
compute
|
compute
|
||||||
res.set_status_code (200)
|
res.set_status_code (200)
|
||||||
res.write_header_text (headers_string)
|
res.put_header_text (headers_string)
|
||||||
if attached message as m then
|
if attached message as m then
|
||||||
res.write_string (m)
|
res.put_string (m)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -80,8 +80,8 @@ feature -- Execution
|
|||||||
execute_unauthorized (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
|
execute_unauthorized (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||||
do
|
do
|
||||||
res.set_status_code ({HTTP_STATUS_CODE}.unauthorized)
|
res.set_status_code ({HTTP_STATUS_CODE}.unauthorized)
|
||||||
res.write_header ({HTTP_STATUS_CODE}.unauthorized, Void)
|
res.put_header ({HTTP_STATUS_CODE}.unauthorized, Void)
|
||||||
res.write_string ("Unauthorized")
|
res.put_string ("Unauthorized")
|
||||||
end
|
end
|
||||||
|
|
||||||
feature -- Auth
|
feature -- Auth
|
||||||
|
|||||||
@@ -53,12 +53,12 @@ feature -- Helper
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
res.set_status_code ({HTTP_STATUS_CODE}.unsupported_media_type)
|
res.set_status_code ({HTTP_STATUS_CODE}.unsupported_media_type)
|
||||||
res.write_header ({HTTP_STATUS_CODE}.unsupported_media_type, << ["Content-Type", "text/plain"], ["Accept", accept_s]>>)
|
res.put_header ({HTTP_STATUS_CODE}.unsupported_media_type, << ["Content-Type", "text/plain"], ["Accept", accept_s]>>)
|
||||||
if accept_s /= Void then
|
if accept_s /= Void then
|
||||||
res.write_string ("Unsupported request content-type, Accept: " + accept_s + "%N")
|
res.put_string ("Unsupported request content-type, Accept: " + accept_s + "%N")
|
||||||
end
|
end
|
||||||
if uri_s /= Void then
|
if uri_s /= Void then
|
||||||
res.write_string ("Unsupported request format from the URI: " + uri_s + "%N")
|
res.put_string ("Unsupported request format from the URI: " + uri_s + "%N")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -78,11 +78,11 @@ feature -- Helper
|
|||||||
s.append_string (c.item)
|
s.append_string (c.item)
|
||||||
end
|
end
|
||||||
res.set_status_code ({HTTP_STATUS_CODE}.method_not_allowed)
|
res.set_status_code ({HTTP_STATUS_CODE}.method_not_allowed)
|
||||||
res.write_header ({HTTP_STATUS_CODE}.method_not_allowed, <<
|
res.put_header ({HTTP_STATUS_CODE}.method_not_allowed, <<
|
||||||
["Content-Type", {HTTP_MIME_TYPES}.text_plain],
|
["Content-Type", {HTTP_MIME_TYPES}.text_plain],
|
||||||
["Allow", s]
|
["Allow", s]
|
||||||
>>)
|
>>)
|
||||||
res.write_string ("Unsupported request method, Allow: " + s + "%N")
|
res.put_string ("Unsupported request method, Allow: " + s + "%N")
|
||||||
end
|
end
|
||||||
|
|
||||||
note
|
note
|
||||||
|
|||||||
@@ -63,8 +63,8 @@ feature -- Execution
|
|||||||
|
|
||||||
h.put_content_length (s.count)
|
h.put_content_length (s.count)
|
||||||
res.set_status_code ({HTTP_STATUS_CODE}.ok)
|
res.set_status_code ({HTTP_STATUS_CODE}.ok)
|
||||||
res.write_header_text (h.string)
|
res.put_header_text (h.string)
|
||||||
res.write_string (s)
|
res.put_string (s)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -136,9 +136,9 @@ feature -- Execution
|
|||||||
h.put_content_type_text_html
|
h.put_content_type_text_html
|
||||||
res.set_status_code ({HTTP_STATUS_CODE}.ok)
|
res.set_status_code ({HTTP_STATUS_CODE}.ok)
|
||||||
h.put_content_length (s.count)
|
h.put_content_length (s.count)
|
||||||
res.write_header_text (h.string)
|
res.put_header_text (h.string)
|
||||||
if not req.request_method.same_string ({HTTP_REQUEST_METHODS}.method_head) then
|
if not req.request_method.same_string ({HTTP_REQUEST_METHODS}.method_head) then
|
||||||
res.write_string (s)
|
res.put_string (s)
|
||||||
end
|
end
|
||||||
res.flush
|
res.flush
|
||||||
end
|
end
|
||||||
@@ -174,8 +174,8 @@ feature -- Execution
|
|||||||
s.append ("Resource %"" + uri + "%" not found%N")
|
s.append ("Resource %"" + uri + "%" not found%N")
|
||||||
res.set_status_code ({HTTP_STATUS_CODE}.not_found)
|
res.set_status_code ({HTTP_STATUS_CODE}.not_found)
|
||||||
h.put_content_length (s.count)
|
h.put_content_length (s.count)
|
||||||
res.write_header_text (h.string)
|
res.put_header_text (h.string)
|
||||||
res.write_string (s)
|
res.put_string (s)
|
||||||
res.flush
|
res.flush
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -190,8 +190,8 @@ feature -- Execution
|
|||||||
s.append ("Resource %"" + uri + "%": Access denied%N")
|
s.append ("Resource %"" + uri + "%": Access denied%N")
|
||||||
res.set_status_code ({HTTP_STATUS_CODE}.forbidden)
|
res.set_status_code ({HTTP_STATUS_CODE}.forbidden)
|
||||||
h.put_content_length (s.count)
|
h.put_content_length (s.count)
|
||||||
res.write_header_text (h.string)
|
res.put_header_text (h.string)
|
||||||
res.write_string (s)
|
res.put_string (s)
|
||||||
res.flush
|
res.flush
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ feature -- Execution
|
|||||||
execute_rescue (req: WSF_REQUEST; res: WSF_RESPONSE)
|
execute_rescue (req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||||
do
|
do
|
||||||
if not res.header_committed then
|
if not res.header_committed then
|
||||||
res.write_header ({HTTP_STATUS_CODE}.internal_server_error, Void)
|
res.put_header ({HTTP_STATUS_CODE}.internal_server_error, Void)
|
||||||
end
|
end
|
||||||
res.flush
|
res.flush
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -149,17 +149,17 @@ feature -- Basic operations
|
|||||||
s: detachable READABLE_STRING_8
|
s: detachable READABLE_STRING_8
|
||||||
do
|
do
|
||||||
res.set_status_code (status_code)
|
res.set_status_code (status_code)
|
||||||
res.write_header_text (header.string)
|
res.put_header_text (header.string)
|
||||||
s := head
|
s := head
|
||||||
if s /= Void then
|
if s /= Void then
|
||||||
res.write_string (s)
|
res.put_string (s)
|
||||||
end
|
end
|
||||||
if not answer_head_request_method then
|
if not answer_head_request_method then
|
||||||
send_file_content_to (file_name, res)
|
send_file_content_to (file_name, res)
|
||||||
end
|
end
|
||||||
s := bottom
|
s := bottom
|
||||||
if s /= Void then
|
if s /= Void then
|
||||||
res.write_string (s)
|
res.put_string (s)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -224,7 +224,7 @@ feature {NONE} -- Implementation: output
|
|||||||
f.exhausted
|
f.exhausted
|
||||||
loop
|
loop
|
||||||
f.read_stream (4_096)
|
f.read_stream (4_096)
|
||||||
res.write_string (f.last_string)
|
res.put_string (f.last_string)
|
||||||
end
|
end
|
||||||
f.close
|
f.close
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user