Skip to content

ring-cors returns response with only normalized headers when handler returns nil and origin header is present #5

@melvinzhang

Description

@melvinzhang

Compojure and other libraries that compose different handlers together expect to try handlers until the first one which returns a response map. Handlers indicate they do not handle a particular request by returning nil instead of a response map.

When wrapping a handler in ring-cors, (add-access-control request (handler request) access-control)) always returns a response map even when (handler request) is nil, this breaks the first non-nil handler logic of routing libraries.

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