Skip to content

Rest service with Spring Boot and Jersey incorrectly returns HTTP Status 404 when resource exist and method is not allowed #3132

Closed
@johanhammar

Description

@johanhammar

Hi!

Description
I've developed a small Rest API using Spring Boot and Jersey. It seems to work well except for when calling the Rest API with a method that is not allowed, i.e calling the service with PUT and only GET is allowed. This leads to a HTTP 404 Not Found instead of HTTP 405 Method Not Allowed.

Workaround
Setting an alternative base path using @ApplicationPath, i.e. @ApplicationPath("/api") results in HTTP 405 Method Not Allowed as expected.

It should be possible to map the api to / using Jersey.

Thanks!

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