Skip to content

Adding the possibility for CORS requests to the pursuit API #463

@mikesol

Description

@mikesol

I'm building a webapp where I'd like to add pursuit search, but fetch requests to pursuit are failing due to access control issues.

I think this could be solved by adding ie:

optionsSearchR :: Handler RepPlain
optionsSearchR = do
    addHeader "Access-Control-Allow-Origin" "*"
    addHeader "Access-Control-Allow-Methods" "GET, OPTIONS"
    return $ RepPlain $ toContent ("" :: Text)

getSearchR :: Handler TypedContent
getSearchR = do
    addHeader "Access-Control-Allow-Origin" "*"

Are there any objections to this? If not I'll make a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions