File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 759
759
:http1-pipeline-transform http1-pipeline-transform
760
760
:continue-executor continue-executor))]
761
761
762
- (when (and (not ssl-context)
763
- (not use-h2c?)
764
- (some #{:http2 } http-versions))
765
- (throw (IllegalArgumentException. " HTTP/2 requires ssl-context to be given or use-h2c? to be true." )))
762
+ (if (some #{:http2 } http-versions)
763
+ (when (and (not ssl-context)
764
+ (not use-h2c?))
765
+ (throw (IllegalArgumentException. " HTTP/2 requires ssl-context to be given or use-h2c? to be true." )))
766
+ (when use-h2c?
767
+ (throw (IllegalArgumentException. " use-h2c? may only be true when HTTP/2 is enabled." ))))
766
768
767
769
(when (and ssl-context
768
770
use-h2c?)
Original file line number Diff line number Diff line change 1416
1416
:http-versions [:http2 ]
1417
1417
:ssl-context test-ssl/server-ssl-context-opts})]
1418
1418
(is (instance? IllegalArgumentException result))
1419
- (is (= " use-h2c? must not be true when ssl-context is given." (ex-message result))))))
1419
+ (is (= " use-h2c? must not be true when ssl-context is given." (ex-message result)))))
1420
+ (testing " h2c without HTTP/2"
1421
+ (let [result (try-start-server
1422
+ {:use-h2c? true
1423
+ :http-versions [:http1 ]})]
1424
+ (is (instance? IllegalArgumentException result))
1425
+ (is (= " use-h2c? may only be true when HTTP/2 is enabled." (ex-message result))))))
You can’t perform that action at this time.
0 commit comments