A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/koajs/trie-router/issues/13 below:

405 -> 404 · Issue #13 · koajs/trie-router · GitHub

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.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4