Skip to content

405 -> 404 #13

@aheckmann

Description

@aheckmann

A request made to a route that has not been defined is returning a 405 instead of 404.

it('missing route should 404', function(done) {
  app.get('/trailing-slash/', function*() {
    this.status = 204
  })

  request(server)
  .get('/trailing-slash')
  .expect(404, done)  // Error: expected 404 "Not Found", got 405 "Method Not Allowed"
});

If the case was that /trailing-slash was defined but not for a GET then a 405 would make sense.

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