aws / aws/chalice

Unable to get `json_body` when Content-Type is 'application/csp-report'

Open
#1,188 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
11.1k
Forks
1k
Avg merge
1d 22h
Merged PRs (30d)
2

Description

Currently the only time you can retrieve the `Request.json_body` is when the `Content-Type` header is set to `application/json`. This means one is unable to retrieve the report payload when the request is a Content Security Policy violation report (as per https://www.w3.org/TR/CSP2/#violation-reports).

This limits using Chalice as an endpoint for `report-uri`.

Contributor guide

Open the contributing guide

Research direction

Start by locating the implementation of Request.json_body and the request-parsing entry point. Verify how Content-Type is matched, then add support for application/csp-report so a CSP violation report payload can be retrieved through Chalice's report-uri endpoint. Done means the payload is available for that content type without breaking application/json handling.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.