반응형
io.netty.handler.codec.http.TooLongHttpLineException: An HTTP line is larger than 4096 bytes.
Request Entity Too Large
Get방식으로 QueryString을 사용하다보면 배열로 값을 넘길 때가 있다.
배열의 크기가 크다보면 요청을 할때 413에러가 발생할 수 있는데 HttpStatus 413의 정의는 아래와 같다
https://developer.mozilla.org/ko/docs/Web/HTTP/Status/413
413 Payload Too Large - HTTP | MDN
The MDN Web Docs site provides information about Open Web technologies including HTML, CSS, and APIs for both Web sites and progressive web apps.
developer.mozilla.org
413 Payload Too Large
HTTP 413 Payload Too Large 응답 상태 코드는 요청 엔터티가 서버에 의해 정의된 제한보다 크다는 것을 나타낸다.
서버가 연결을 닫거나 헤더 필드(Retry-After)를 반환할 수 있다.
해결방법
Spring Boot Web를 사용한다면 Tomcat Server를 사용할 것이고, 이때 서버 설정중 max-http-header-size를 조절해 주면 된다.
# application.yml
server:
port: 4008
max-http-header-size: 48KB #Default 8KB
Spring Cloud Gateway를 사용하게 된다면 Netty를 사용할것이고 이때는 설정중 max-initial-line-length 을 변경해 주어야한다
# application.yml
server:
netty:
max-initial-line-length: 48KB #Default 4KB
Spring Boot의 기본 프로퍼티의 내용은 아래를 참고 하자
https://docs.spring.io/spring-boot/docs/current/reference/html/application-properties.html
Common Application Properties
docs.spring.io
반응형
'개발' 카테고리의 다른 글
[GitHub]remote: fatal error in commit_refs (0) | 2023.03.27 |
---|---|
Mac Book사용시 5000번 Port (0) | 2022.11.30 |
AWS 자격증명 관리(Local) (0) | 2022.11.02 |
Spring Cloud Stream - Kafka 사용시 새로 생성된 Consumer Group의 Offset 설정 (0) | 2022.10.14 |
Docker Compose를 사용한 Redis Commander (0) | 2022.10.13 |