Skip to content

Commit 8e06062

Browse files
committed
FIX: Using query on URL sometimes reports date: none
resolves: Oldes/Rebol-issues#2496
1 parent 19f638e commit 8e06062

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/mezz/prot-http.reb

+12-5
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ REBOL [
1212
Licensed under the Apache License, Version 2.0
1313
See: http://www.apache.org/licenses/LICENSE-2.0
1414
}
15-
Version: 0.4.0
16-
Date: 4-Feb-2022
15+
Version: 0.4.1
16+
Date: 13-Jun-2022
1717
File: %prot-http.r
1818
Purpose: {
1919
This program defines the HTTP protocol scheme for REBOL 3.
@@ -36,6 +36,7 @@ REBOL [
3636
0.3.4 26-Feb-2020 "Oldes" "FIX: limit input data according Content-Length (#issues/2386)"
3737
0.3.5 26-Oct-2020 "Oldes" "FEAT: support for read/part (using Range request with read/part/binary)"
3838
0.4.0 04-Feb-2022 "Oldes" "FIX: situation when server does not provide Content-Length and just closes connection"
39+
0.4.1 13-Jun-2022 "Oldes" "FIX: Using `query` on URL sometimes reports `date: none`"
3940
]
4041
]
4142

@@ -319,7 +320,7 @@ parse-write-dialect: func [port block /local spec][
319320
[set block [any-string! | binary! | map!] (spec/content: block) | (spec/content: none)]
320321
]
321322
]
322-
check-response: func [port /local conn res headers d1 d2 line info state awake spec][
323+
check-response: func [port /local conn res headers d1 d2 line info state awake spec date][
323324
state: port/state
324325
spec: port/spec
325326
conn: state/connection
@@ -356,8 +357,14 @@ check-response: func [port /local conn res headers d1 d2 line info state awake s
356357
][
357358
awake make event! [type: 'error port: port]
358359
]
359-
; allow invalid date, but ignore it on error
360-
try [if headers/last-modified [info/date: to-date/utc headers/last-modified]]
360+
if date: any [
361+
;@@ https://github.com/Oldes/Rebol-issues/issues/2496
362+
select headers 'last-modified
363+
select headers 'date
364+
][
365+
; allow invalid date, but ignore it on error
366+
try [info/date: to-date/utc date]
367+
]
361368
remove/part conn/data d2
362369
state/state: 'reading-data
363370
]

0 commit comments

Comments
 (0)