Skip to content
This repository was archived by the owner on Aug 24, 2022. It is now read-only.
This repository was archived by the owner on Aug 24, 2022. It is now read-only.

Compatibility with Immutant websocket middleware #46

@Deraen

Description

@Deraen

https://github.com/immutant/immutant/blob/2.0.0-beta1/web/src/immutant/web/websocket.clj#L72

In Immutant websocket connection can be initialized from middleware or from standard ring handler. In former case it's possible to reorder middlewares so that r-m-f doesn't see the response from websocket middleware.

Another solution is to provide custom predicate to wrap-restful-response:

(defn serializable?
  [{:keys [websocket?] :as request} {:keys [body] :as response}]
  (when response
    (not (or
          websocket?
          (string? body)
          (instance? File body)
          (instance? InputStream body)))))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions