aws-amplify / aws-amplify/amplify-hosting

Next Js header "Content-Length" return 400

Open
#3,739 1 comment 0 reactions 0 assignees View on GitHub
custom-headers question
Dominant language
Dockerfile
Stars
481
Forks
123
PR merge metrics
No merged PRs in 30d

Description

### Before opening, please confirm:

- [X] I have checked to see if my question is addressed in the [FAQ](https://github.com/aws-amplify/amplify-hosting/blob/master/FAQ.md).
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-hosting/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting questions](https://github.com/aws-amplify/amplify-hosting/blob/master/CONTRIBUTING.md).
- [X] I have removed any sensitive information from my code snippets and submission.

### App Id

arn:aws:amplify:eu-north-1:295755663158:apps/d1ty4ypfqegqr4

### AWS Region

eu-north-1

### Amplify Hosting feature

Custom headers

### Question

AWS apmplify host Next Js app. If the get request containt header "Content-Length", then response are with status 400 and body:

400 Bad Request

400 Bad Request

For example get https://sbcapi.belam.lv/api/sbc/anyurl/ will return 404 {"status":"error"} without "Content-Length" header, but with this header 400. Locally hosted app accept "Content-Length".
Is it possible enable ""Content-Length" header support in aws service?

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported GET request for https://sbcapi.belam.lv/api/sbc/anyurl/ with and without the Content-Length header, using the Amplify Hosting custom headers feature in eu-north-1. Compare the 400 response with the expected 404 response and determine whether the behavior is specific to AWS Amplify Hosting or the deployed Next.js app.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, next.js
Domain
cloud, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.