aws / aws/chalice

Return 404 instead of 403 for invalid routes

Open
#975 1 comment 7 reactions 0 assignees View on GitHub
feature-request
Dominant language
Python
Stars
11.1k
Forks
1k
Avg merge
1d 22h
Merged PRs (30d)
2

Description

For invalid routes, chalice should return 404 instead of 403

```py
from chalice import Chalice

app = Chalice(app_name='helloworld')

app.debug = True

@app.route('/')
def index():
return {'hello': 'world'}
```

```sh
http :8000
HTTP/1.1 200 OK
Content-Length: 18
Content-Type: application/json
Date: Wed, 31 Oct 2018 09:40:45 GMT
Server: BaseHTTP/0.6 Python/3.6.6

{
"hello": "world"
}

http :8000/hello
HTTP/1.1 403 Forbidden
Content-Length: 43
Content-Type: application/json
Date: Wed, 31 Oct 2018 09:38:10 GMT
Server: BaseHTTP/0.6 Python/3.6.6
x-amzn-ErrorType: UnauthorizedException
x-amzn-RequestId: 1ffba607-ff3d-42c9-bdb9-78d1630c861d

{
"message": "Missing Authentication Token"
}
```

Contributor guide

Open the contributing guide

Research direction

Start by running the provided Chalice app and requesting both `/` and `/hello` as shown. Trace the local route handling that produces the 403 response, then verify that an invalid route returns HTTP 404 while the valid route remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, python
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.