Skip to content

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

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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