You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: src/mezz/prot-http.reb
+10-8
Original file line number
Diff line number
Diff line change
@@ -12,9 +12,9 @@ REBOL [
12
12
Licensed under the Apache License, Version 2.0
13
13
See: http://www.apache.org/licenses/LICENSE-2.0
14
14
}
15
-
Version: 0.5.1
16
-
Date:12-Jun-2023
17
-
File:%prot-http.r
15
+
Version: 0.5.2
16
+
Date:22-Jul-2023
17
+
File:%prot-http.r3
18
18
Purpose:{
19
19
This program defines the HTTP protocol scheme for REBOL 3.
20
20
}
@@ -39,6 +39,7 @@ REBOL [
39
39
0.4.1 13-Jun-2022 "Oldes""FIX: Using `query` on URL sometimes reports `date: none`"
40
40
0.5.0 18-Jul-2022 "Oldes""FEAT: `read/seek` and `read/all` implementation"
41
41
0.5.1 12-Jun-2023 "Oldes""FEAT: anonymize authentication tokens in log"
42
+
0.5.2 22-Jul-2023 "Oldes""FEAT: support for optional Brotli encoding"
42
43
]
43
44
]
44
45
@@ -673,12 +674,10 @@ decode-result: func[
673
674
/local body content-type code-page encoding
674
675
][
675
676
ifencoding: select result/2 'Content-Encoding [
676
-
either find ["gzip""deflate"] encoding [
677
+
either find ["gzip""deflate""br"] encoding [
678
+
if encoding =="br" [encoding: 'brotli]
677
679
try/with [
678
-
result/3:switch encoding [
679
-
"gzip" [ decompress result/3 'gzip]
680
-
"deflate" [ decompress result/3 'deflate]
681
-
]
680
+
result/3:decompress result/3toword! encoding
682
681
][
683
682
sys/log/info 'HTTP ["Failed to decode data using:^[[22m" encoding]
684
683
return result
@@ -959,6 +958,9 @@ sys/make-scheme [
959
958
;@@ One can set above value for example to: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36"
960
959
;@@ And so pretend that request is coming from Chrome on Windows10
0 commit comments