Skip to content

Commit

Permalink
Jetty9: also send resp body on WS upgrade fail
Browse files Browse the repository at this point in the history
  • Loading branch information
wavejumper committed Apr 7, 2022
1 parent f715f9f commit a964528
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions slipway-jetty9/src/slipway/jetty9/websockets.clj
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@
(when-let [exts (not-empty (:extensions ws-results))]
(.setExtensions resp (mapv #(ExtensionConfig. ^String %) exts)))
(proxy-ws-adapter ws-results))
;; If we don't get a ws-response, send appropriate status code + generic error message
(.sendError resp (get resp-map :status 500) "Unable to handle WS upgrade request")))
;; If we don't get a ws-response, send appropriate status code + error message
(.sendError resp (:status resp-map 500) (str (:body resp-map "Unable to handle WS upgrade request")))))
;; This should be handled by the ring-app-handler handler, but be extra defensive anyway
(.sendError resp 406 "Unable to process request"))))))

Expand Down

0 comments on commit a964528

Please sign in to comment.