Skip to content

Commit 2ae0f91

Browse files
committed
inets: change uri_string:uri_string() type to string() where needed
Some parameters, such as ContentType in httpc:request/4, are wrongly documented as uri_string:uri_string(), but they don't allow binary values.
1 parent 928d03e commit 2ae0f91

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

lib/inets/src/http_client/httpc.erl

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ profile_name(_Prefix, Profile) when is_pid(Profile) ->
9191
, HttpBodyResult}
9292
| RequestId
9393
| saved_to_file,
94-
HttpBodyResult :: uri_string:uri_string() | binary(),
95-
HttpVersion :: uri_string:uri_string(),
94+
HttpBodyResult :: string() | binary(),
95+
HttpVersion :: string(),
9696
StatusCode :: non_neg_integer(),
9797
HttpHeader :: { Field :: [byte()]
9898
, Value :: binary() | iolist()},
@@ -109,11 +109,11 @@ request(Url) ->
109109
| saved_to_file,
110110
HttpHeader :: { Field :: [byte()]
111111
, Value :: binary() | iolist()},
112-
HttpBodyResult :: uri_string:uri_string() | binary(),
112+
HttpBodyResult :: string() | binary(),
113113
StatusLine :: { HttpVersion
114114
, StatusCode
115115
, string()},
116-
HttpVersion :: uri_string:uri_string(),
116+
HttpVersion :: string(),
117117
StatusCode :: non_neg_integer(),
118118
RequestId :: any().
119119
request(Url, Profile) ->
@@ -131,7 +131,7 @@ request(Url, Profile) ->
131131
, [HttpHeader] }
132132
| { uri_string:uri_string()
133133
, [ HttpHeader ]
134-
, ContentType::uri_string:uri_string()
134+
, ContentType::string()
135135
, HttpBody},
136136
HttpBody :: iolist()
137137
| binary()
@@ -173,10 +173,10 @@ request(Url, Profile) ->
173173
StatusLine :: { HttpVersion
174174
, StatusCode
175175
, string()},
176-
HttpVersion :: uri_string:uri_string(),
176+
HttpVersion :: string(),
177177
HttpHeader :: { Field :: [byte()]
178178
, Value :: binary() | iolist()},
179-
HttpBodyResult :: uri_string:uri_string() | binary(),
179+
HttpBodyResult :: string() | binary(),
180180
RequestId :: any().
181181
request(Method, Request, HttpOptions, Options) ->
182182
request(Method, Request, HttpOptions, Options, default_profile()).
@@ -191,7 +191,7 @@ request(Method, Request, HttpOptions, Options) ->
191191
, [HttpHeader] }
192192
| { uri_string:uri_string()
193193
, [ HttpHeader ]
194-
, ContentType::uri_string:uri_string()
194+
, ContentType::string()
195195
, HttpBody},
196196
HttpBody :: iolist()
197197
| binary()
@@ -228,7 +228,7 @@ request(Method, Request, HttpOptions, Options) ->
228228
, ReceiverFunction::atom()
229229
, ReceiverArgs::list()},
230230
Profile :: atom() | pid(),
231-
HttpVersion :: uri_string:uri_string(),
231+
HttpVersion :: string(),
232232
Result :: {StatusLine
233233
, [HttpHeader]
234234
, HttpBodyResult}
@@ -238,7 +238,7 @@ request(Method, Request, HttpOptions, Options) ->
238238
| saved_to_file,
239239
StatusLine :: { HttpVersion, StatusCode, string()},
240240
StatusCode :: non_neg_integer(),
241-
HttpBodyResult :: uri_string:uri_string() | binary(),
241+
HttpBodyResult :: string() | binary(),
242242
RequestId :: any().
243243
request(Method, Request, HTTPOptions, Options, Profile)
244244
when is_atom(Profile) orelse is_pid(Profile) ->
@@ -334,15 +334,15 @@ cancel_request(RequestId, Profile)
334334
PipelineTimeout :: integer(),
335335
CookieMode :: enabled | disabled | verify,
336336
IpFamily :: inet | inet6 | local | inet6fb4,
337-
IpAddressDesc :: uri_string:uri_string(),
337+
IpAddressDesc :: string(),
338338
IpAddress :: inet:ip_address(),
339339
VerboseMode :: false | verbose | debug | trace,
340340
SocketOpts :: [SocketOpt],
341341
SocketOpt :: term(),
342342
UnixSocket :: file:name_all(),
343343
Reason :: term(),
344344
DomainDesc :: string(),
345-
HostName :: uri_string:uri_string().
345+
HostName :: string().
346346
set_options(Options) ->
347347
set_options(Options, default_profile()).
348348

@@ -375,13 +375,13 @@ set_options(Options) ->
375375
PipelineTimeout :: integer(),
376376
CookieMode :: enabled | disabled | verify,
377377
IpFamily :: inet | inet6 | local | inet6fb4,
378-
IpAddressDesc :: uri_string:uri_string(),
378+
IpAddressDesc :: string(),
379379
IpAddress :: inet:ip_address(),
380380
VerboseMode :: false | verbose | debug | trace,
381381
UnixSocket :: string(),
382382
Reason :: term(),
383383
DomainDesc :: string(),
384-
HostName :: uri_string:uri_string().
384+
HostName :: string().
385385
set_options(Options, Profile) when is_atom(Profile) orelse is_pid(Profile) ->
386386
case validate_options(Options) of
387387
{ok, Opts} ->

0 commit comments

Comments
 (0)