add "write_headers_string" to RESPONSE_BUFFER
This commit is contained in:
@@ -64,7 +64,7 @@ feature -- Execution
|
||||
n := 3
|
||||
h.put_refresh (l_url, 5, 200)
|
||||
res.set_status_code (200)
|
||||
res.write_string (h.string)
|
||||
res.write_headers_string (h.string)
|
||||
from
|
||||
create e
|
||||
until
|
||||
|
||||
@@ -97,6 +97,16 @@ feature -- Output operation
|
||||
|
||||
feature -- Header output operation
|
||||
|
||||
write_headers_string (a_headers: STRING)
|
||||
require
|
||||
status_set: status_is_set
|
||||
header_not_committed: not header_committed
|
||||
deferred
|
||||
ensure
|
||||
status_set: status_is_set
|
||||
header_committed: header_committed
|
||||
end
|
||||
|
||||
write_header (a_status_code: INTEGER; a_headers: detachable ARRAY [TUPLE [key: STRING; value: STRING]])
|
||||
-- Send headers with status `a_status', and headers from `a_headers'
|
||||
require
|
||||
|
||||
@@ -31,7 +31,7 @@ feature {EWSGI_RESPONSE_APPLICATION} -- Response status
|
||||
transmit_to (res: EWSGI_RESPONSE_BUFFER)
|
||||
do
|
||||
res.set_status_code (status)
|
||||
res.write_string (headers)
|
||||
res.write_headers_string (headers)
|
||||
from
|
||||
read_block
|
||||
res.write_string (last_block)
|
||||
|
||||
@@ -115,6 +115,18 @@ feature -- Output operation
|
||||
|
||||
feature -- Header output operation
|
||||
|
||||
write_headers_string (a_headers: STRING)
|
||||
require
|
||||
status_set: status_is_set
|
||||
header_not_committed: not header_committed
|
||||
do
|
||||
write (a_headers)
|
||||
header_committed := True
|
||||
ensure
|
||||
status_set: status_is_set
|
||||
header_committed: header_committed
|
||||
end
|
||||
|
||||
write_header (a_status_code: INTEGER; a_headers: detachable ARRAY [TUPLE [key: STRING; value: STRING]])
|
||||
-- Send headers with status `a_status', and headers from `a_headers'
|
||||
require
|
||||
@@ -138,8 +150,7 @@ feature -- Header output operation
|
||||
i := i + 1
|
||||
end
|
||||
end
|
||||
write (h.string)
|
||||
header_committed := True
|
||||
write_headers_string (h.string)
|
||||
ensure
|
||||
status_set: status_is_set
|
||||
header_committed: header_committed
|
||||
|
||||
Reference in New Issue
Block a user