on master help sign in
Merge branch 'tolysz-issues/462' into wai-3.0-warp-3.1
b247d96Kazu Yamamoto
warp-tls/Network/Wai/Handler/WarpTLS.hs+5−1
@@ -462,7 +462,11 @@ plainHTTP TLSSettings{..} s bs0 = case onInsecure of
462 }
462 }
463 return (conn'', TCP)
463 return (conn'', TCP)
464 DenyInsecure lbs -> do
464 DenyInsecure lbs -> do
465+ -- http://tools.ietf.org/html/rfc2817#section-4.2
466+ sendAll s "HTTP/1.1 426 Upgrade Required\
467+ \r\nUpgrade: TLS/1.0, HTTP/1.1\
468+ \r\nConnection: Upgrade\
465− sendAll s "HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\n\r\n"
469+ \r\nContent-Type: text/plain\r\n\r\n"
466 mapM_ (sendAll s) $ L.toChunks lbs
470 mapM_ (sendAll s) $ L.toChunks lbs
467 sClose s
471 sClose s
468 throwIO InsecureConnectionDenied
472 throwIO InsecureConnectionDenied