File tree Expand file tree Collapse file tree 2 files changed +19
-5
lines changed
Expand file tree Collapse file tree 2 files changed +19
-5
lines changed Original file line number Diff line number Diff line change 208208 control-period 60000
209209 middleware middleware/wrap-request
210210 max-queue-size 65536 }}]
211- (when (and (false ? (:keep-alive? connection-options))
212- (pos? (:idle-timeout connection-options 0 )))
213- (throw
214- (IllegalArgumentException.
211+ (let [{:keys [keep-alive?
212+ idle-timeout
213+ http-versions
214+ force-h2c?]
215+ :or {idle-timeout 0 }} connection-options]
216+ (when (and (false ? keep-alive?) (pos? idle-timeout))
217+ (throw
218+ (IllegalArgumentException.
215219 " :idle-timeout option is not allowed when :keep-alive? is explicitly disabled" )))
220+ (when (and force-h2c? (not-any? #{:http2 } http-versions))
221+ (throw (IllegalArgumentException. " force-h2c? may only be true when HTTP/2 is enabled." ))))
216222
217223 (let [log-activity (:log-activity connection-options)
218224 dns-options' (if-not (and (some? dns-options)
Original file line number Diff line number Diff line change 16091609 {:connection-options
16101610 {:force-h2c? true
16111611 :http-versions [:http2 ]}})]
1612- (is (= :success result)))))))
1612+ (is (= :success result))))
1613+
1614+ (testing " h2c without HTTP/2"
1615+ (let [result (try-request-with-pool
1616+ {:connection-options
1617+ {:force-h2c? true
1618+ :http-versions [:http1 ]}})]
1619+ (is (instance? IllegalArgumentException result))
1620+ (is (= " force-h2c? may only be true when HTTP/2 is enabled." (ex-message result))))))))
16131621
16141622
16151623(deftest test-in-flight-request-cancellation
You can’t perform that action at this time.
0 commit comments