Skip to content

Commit d83cf1c

Browse files
committed
FIX: HTTP redirection does not handle correctly locations with url-encoded content
resolves: #26
1 parent 48ac5c7 commit d83cf1c

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/mezz/prot-http.reb

+5-4
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,10 @@ do-request: func [
275275
info/headers: info/response-line: info/response-parsed: port/data:
276276
info/size: info/date: info/name: none
277277

278-
;sys/log/info 'HTTP ["Request:^[[22m" spec/method spec/host spec/path]
278+
;sys/log/info 'HTTP ["Request:^[[22m" spec/method spec/host mold spec/path]
279279

280-
write port/state/connection make-http-request spec/method enhex as file! any [spec/path %/] spec/headers spec/content
280+
;write port/state/connection make-http-request spec/method enhex as file! any [spec/path %/] spec/headers spec/content
281+
write port/state/connection make-http-request spec/method any [spec/path %/] spec/headers spec/content
281282
]
282283
parse-write-dialect: func [port block /local spec][
283284
spec: port/spec
@@ -477,7 +478,7 @@ do-redirect: func [port [port!] new-uri [url! string! file!] /local spec state h
477478
state: port/state
478479
port/data: none
479480

480-
new-uri: as url! new-uri
481+
;new-uri: as url! new-uri
481482

482483
sys/log/info 'HTTP ["Redirect to:^[[m" mold new-uri]
483484

@@ -501,7 +502,7 @@ do-redirect: func [port [port!] new-uri [url! string! file!] /local spec state h
501502
unless select new-uri 'port-id [
502503
switch new-uri/scheme [
503504
'https [append new-uri [port-id: 443]]
504-
'http [append new-uri [port-id: 80]]
505+
'http [append new-uri [port-id: 80 ]]
505506
]
506507
]
507508
new-uri: construct/with new-uri port/scheme/spec

src/mezz/prot-tls.reb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1794,7 +1794,7 @@ TLS-awake: function [event [event!]][
17941794
]
17951795
TLS-port/data: TLS-port/state/port-data
17961796
binary/init TLS-port/state/in none ; resets input buffer
1797-
?? TLS-port/state/protocol
1797+
;?? TLS-port/state/protocol
17981798
either 'APPLICATION = TLS-port/state/protocol [
17991799
;print "------------------"
18001800
;- report that we have data to higher layer

0 commit comments

Comments
 (0)