Now WGI_RESPONSE.set_status_code (..) has a new argument to pass optional custom reason phrase.

This is a minor breaking change (but prior to the first release, so acceptable)
   And then it is now possible to precise a custom reason phrase (useful for 4xx and 5xx response)

At the WSF_RESPONSE level, the status code is now sent only when the header are sent.
thus, it is possible to change the status code as long as no header is sent.
(in the future, we should also try to delay the sending of headers)

Removed WGI_RESPONSE.put_header_lines (..) which was not used, and WGI is not meant to provide such user friendly features
Now this is available directly on WSF_RESPONSE
This commit is contained in:
Jocelyn Fiat
2012-04-12 11:19:41 +02:00
parent 082def2b70
commit b541efcc8f
14 changed files with 149 additions and 70 deletions

View File

@@ -54,6 +54,7 @@ feature -- Execution
curl_easy: CURL_EASY_EXTERNALS
curl_handle: POINTER
ctx: like context
l_proxy: like proxy
do
ctx := context
curl := session.curl
@@ -83,7 +84,14 @@ feature -- Execution
curl_easy.setopt_integer (curl_handle, {CURL_OPT_CONSTANTS}.curlopt_header, 1)
--| PROXY ...
if ctx /= Void and then attached ctx.proxy as l_proxy then
if ctx /= Void then
l_proxy := ctx.proxy
end
if l_proxy = Void then
l_proxy := proxy
end
if l_proxy /= Void then
curl_easy.setopt_integer (curl_handle, {CURL_OPT_CONSTANTS}.curlopt_proxyport, l_proxy.port)
curl_easy.setopt_string (curl_handle, {CURL_OPT_CONSTANTS}.curlopt_proxy, l_proxy.host)
end
@@ -104,6 +112,12 @@ feature -- Execution
curl_easy.setopt_integer (curl_handle, {CURL_OPT_CONSTANTS}.curlopt_followlocation, 0)
end
--| SSL
if is_insecure then
curl_easy.setopt_integer (curl_handle, {CURL_OPT_CONSTANTS}.curlopt_ssl_verifyhost, 0)
curl_easy.setopt_integer (curl_handle, {CURL_OPT_CONSTANTS}.curlopt_ssl_verifypeer, 0)
end
if request_method.is_case_insensitive_equal ("GET") then
curl_easy.setopt_integer (curl_handle, {CURL_OPT_CONSTANTS}.curlopt_httpget, 1)
elseif request_method.is_case_insensitive_equal ("POST") then