Skip to content

Less specific 404 takes precendence over more specific 405 when serveDirectory is used #408

Closed
@sol

Description

@sol

Given the following API

type MyAPI = "run" :> Post '[JSON] () :<|> Raw

server :: Server MyAPI
server = liftIO runJob :<|> serveDirectory "static"

doing a GET request to /run will result in a 404 instead of the desired 405.

I assume this is because we try handlers in order until we get something different from 4xx. I'm also not sure what's the right way to fix this, so I'm mainly leaving this here to get more input.

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