Skip to content

Commit 8654081

Browse files
committed
Include the `url' in the http client response.
This way, we can get the real url used by the lib, especially when there are query parameters.
1 parent 504e013 commit 8654081

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

library/network/http_client/src/http_client_response.e

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ create
1313

1414
feature {NONE} -- Initialization
1515

16-
make
16+
make (a_url: like url)
1717
-- Initialize `Current'.
1818
do
1919
--| Default values
2020
status := 200
21+
url := a_url
2122
create {STRING_8} raw_header.make_empty
2223
end
2324

@@ -36,6 +37,9 @@ feature {HTTP_CLIENT_REQUEST} -- Status setting
3637

3738
feature -- Access
3839

40+
url: STRING_8
41+
-- URL associated with Current response
42+
3943
status: INTEGER assign set_status
4044
-- Status code of the response.
4145

library/network/http_client/src/spec/libcurl/libcurl_http_client_request.e

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ feature -- Execution
207207
create l_curl_string.make_empty
208208
curl_easy.setopt_curl_string (curl_handle, {CURL_OPT_CONSTANTS}.curlopt_writedata, l_curl_string)
209209

210-
create Result.make
210+
create Result.make (l_url)
211211
l_result := curl_easy.perform (curl_handle)
212212

213213
--| Result
@@ -224,7 +224,7 @@ feature -- Execution
224224
curl.global_cleanup
225225
curl_easy.cleanup (curl_handle)
226226
else
227-
create Result.make
227+
create Result.make (url)
228228
Result.set_error_occurred (True)
229229
end
230230

0 commit comments

Comments
 (0)