File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9393(def default-encoder-weights
9494 " Weightings for which encoder to favor when the client has no preference.
9595 Higher values win out over lower ones."
96- {" zstd" 5
97- " br" 4
98- " gzip" 3
96+ {" zstd" 6
97+ " br" 5
98+ " gzip" 4
99+ " x-gzip" 3
99100 " deflate" 2
100101 " identity" 1 })
101102
105106 {" br" 50
106107 " deflate" 48
107108 " gzip" 48
109+ " x-gzip" 48
108110 " zstd" 50 })
109111
110112(def default-encoders
111113 " A map of encoder names to their respective default functions."
112114 {" br" (brotli-encoder )
113115 " deflate" (deflate-encoder )
114116 " gzip" (gzip-encoder )
117+ " x-gzip" (gzip-encoder )
115118 " zstd" (zstandard-encoder )})
116119
117120(def default-status-codes
Original file line number Diff line number Diff line change 2828 0 86 -79 23 74 11 0 0 0 ]
2929 (vec (.toByteArray out))))))
3030
31+ (deftest x-gzip-content-encoding-test
32+ (let [response (ce/content-encoding-response
33+ plain-response
34+ {:headers {" accept-encoding" " x-gzip" }})
35+ out (ByteArrayOutputStream. )]
36+ (p/write-body-to-stream (:body response) response out)
37+ (is (= {:status 200
38+ :headers {" Content-Type" " text/plain; charset=utf-8"
39+ " Content-Encoding" " x-gzip" }}
40+ (dissoc response :body )))
41+ (is (= [31 -117 8 0 0 0 0 0 0 -1 -13 72 -51 -55 -55 87 8 -49 47 -54 73 1
42+ 0 86 -79 23 74 11 0 0 0 ]
43+ (vec (.toByteArray out))))))
44+
3145(deftest gzip-content-encoding-params-test
3246 (let [response (ce/content-encoding-response
3347 {:status 200
You can’t perform that action at this time.
0 commit comments