Skip to content

Commit cd3679e

Browse files
thetrimeJan Wielemaker
authored andcommitted
FIXED: library(http_open): Include the path/1 in the parsed URL so that http_cookie can correctly use it to identify cookies with specific paths to be included in requests. Failure to include path/1 means that http_cookie will default to / which is not correct
1 parent d1e9535 commit cd3679e

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

http_open.pl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,6 +1238,7 @@
12381238

12391239
components(Components) -->
12401240
uri_scheme(Components),
1241+
uri_path(Components),
12411242
uri_authority(Components),
12421243
uri_request_uri(Components).
12431244

@@ -1248,6 +1249,18 @@
12481249
].
12491250
uri_scheme(_) --> [].
12501251

1252+
uri_path(Components) -->
1253+
{ uri_data(path, Components, Path0), nonvar(Path0),
1254+
( Path0 == ''
1255+
-> Path = (/)
1256+
; Path = Path0
1257+
)
1258+
},
1259+
!,
1260+
[ path(Path)
1261+
].
1262+
uri_path(_) --> [].
1263+
12511264
uri_authority(Components) -->
12521265
{ uri_data(authority, Components, Auth), nonvar(Auth),
12531266
!,

0 commit comments

Comments
 (0)