- (WGI|WSF)_RESPONSE(*) renamed write_headers_string as write_header_text

- HTTP_HEADER.string does not have the ending CRLFCRLF .. but just CRLF
- WGI_RESPONSE.write_header_text has the responsibility to handle the last blank line CRLF (separating the header from the message)
- HTTP_HEADER.string does not set anymore a default content type as text/html
- added WGI_RESPONSE.write_header_lines (ITERABLE [TUPLE [name,value: READABLE_STRING_8]] mainly as an helper method,
   this way the WGI user does not have to know about the CRLF end of line
This commit is contained in:
Jocelyn Fiat
2011-11-25 20:43:04 +01:00
parent e0ec84611e
commit cdfc6851e7
15 changed files with 78 additions and 38 deletions

View File

@@ -158,7 +158,7 @@ feature -- Output
send (buf: WSF_RESPONSE)
do
buf.set_status_code (200)
buf.write_headers_string (header_string)
buf.write_header_text (header_string)
buf.write_string (message_string)
end

View File

@@ -133,7 +133,7 @@ feature -- Output
do
compute
res.set_status_code (200)
res.write_headers_string (headers_string)
res.write_header_text (headers_string)
if attached message as m then
res.write_string (m)
end

View File

@@ -88,7 +88,7 @@ feature -- Execution
end
if not s.is_empty then
res.set_status_code ({HTTP_STATUS_CODE}.ok)
res.write_headers_string (h.string)
res.write_header_text (h.string)
res.write_string (s)
end
else

View File

@@ -80,7 +80,7 @@ feature -- Execution
end
res.set_status_code (200)
res.write_headers_string (h.string)
res.write_header_text (h.string)
res.write_string (s)
end

View File

@@ -92,7 +92,7 @@ feature -- Execution
s.append ("You are being redirected to <a href=%"" + l_redir_url + "%">/doc</a> in 2 seconds ...%N")
h.put_content_length (s.count)
res.set_status_code ({HTTP_STATUS_CODE}.temp_redirect)
res.write_headers_string (h.string)
res.write_header_text (h.string)
res.write_string (s)
end