Comments (1)
I don't think this is strictly a Spring issue. As of Spring Framework 6.1, we only read the amount of bytes that are declared in the Content-Length header of the request.
Using httpie and Spring Boot 3.2.x, I'm getting the correct result:
http -vvv --form POST localhost:8080/test A='0:1' B='123'
POST /test HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 13
Content-Type: application/x-www-form-urlencoded; charset=utf-8
Host: localhost:8080
User-Agent: HTTPie/3.2.2
A=0%3A1&B=123
HTTP/1.1 200
Connection: keep-alive
Content-Length: 0
Date: Mon, 25 Mar 2024 18:17:16 GMT
Keep-Alive: timeout=60
Note, the "Content-Length" header shows "13".
With the curl command listed above, the content is URL encoded but somehow the Content-Length is only 10.
curl -vv -X POST 'http://localhost:8080/test' -d 'A=0:1' -d 'B=123'
Note: Unnecessary use of -X or --request, POST is already inferred.
* Trying [::1]:8080...
* Connected to localhost (::1) port 8080
> POST /test HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/8.4.0
> Accept: */*
> Content-Length: 11
> Content-Type: application/x-www-form-urlencoded
>
< HTTP/1.1 200
< Content-Length: 0
< Date: Mon, 25 Mar 2024 18:22:18 GMT
<
* Connection #0 to host localhost left intact
I'm not a curl expert, so I don't know if this is a bug or the expected behavior. I do know though that using the --data-urlencode
option fixes things:
curl -X POST 'http://localhost:8080/test' --data-urlencode 'A=0:1' -d 'B=123'
I'm closing this issue as a result, as there's nothing we can do from our side since the request is invalid in the first place when the problem happens.
Thanks for your report!
from spring-boot.
Related Issues (20)
- When using Maven, configuring the spring-boot.excludes or spring-boot-includes user properties causes the build to fail with "Cannot find default setter"
- When using Maven, configuring the spring-boot.excludes or spring-boot-includes user properties causes the build to fail with "Cannot find default setter"
- flyway connection error for r2dbc in testcontainers in Spring boot versions >= 3.x.x HOT 3
- Log4j2LoggingSystem pollutes Log4j2's environment with a SpringEnvironmentPropertySource that is never removed
- Log4j2LoggingSystem pollutes Log4j2's environment with a SpringEnvironmentPropertySource that is never removed
- Flyway is looking for actual url while building the application HOT 1
- Spring hibernate is throwing java.lang.NoClassDefFoundError: javax/transaction/SystemException HOT 1
- ClientObservationConventionAdapter overwrites WebClient request attributes HOT 2
- Upgrade to Awaitility 4.2.1
- Upgrade to Brave 6.0.3
- Upgrade to Elasticsearch Client 8.13.2
- Upgrade to Infinispan 15.0.1.Final
- Upgrade to R2DBC Postgresql 1.0.5.RELEASE
- Upgrade to Spring HATEOAS 2.3.0-RC1
- Null id generated for entity ABC when using Spring Boot 3.2.4 and embedded id HOT 1
- Consider mentioning OpenTelemetry Spring Boot starter in reference manual
- Message not included in ErrorAttributes for non-RuntimeExceptions HOT 2
- Add a property for configuring additional livereload paths
- missing reflection data for `CGLIB$SET_THREAD_CALLBACKS` in configuration properties class HOT 3
- Configuration properties validation is propagated to non-@Valid fields
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-boot.