Comments (4)
I experienced this issue with s3sync's s3cmd script. It may send a content-type header without the value.
Apparently this behavior is intended: http://github.com/richmeyers/s3sync/blob/master/lib/s3sync/S3.rb#L297
Sample request: http://gist.github.com/519415#file_sample%20s3sync%20s3cmd%20request
Backtrace: http://gist.github.com/519415#file_backtrace
Overlay patch: http://gist.github.com/519415#file_rack_content_type_patch.rb
from rack.
Patch: http://github.com/richmeyers/rack/commit/e70161d385037dc6a8d7b6cd67d0321e8ca4ff69
Tests: http://github.com/richmeyers/rack/commit/fbfe78a594513d942d2cafbc6d96a5ce01a0ddd2
from rack.
I ran into this problem with Sinatra 1.1 / rack-jetty 0.10 / rack 1.2.1 just today, attempting to put a web application together.
It seems that rack-jetty triggers this bug by always setting env['CONTENT_TYPE'] to a string, regardless of the actual HTTP request - if it's not present, it sets it as a blank string (''). This seems to be in order to correct a Rack::Lint error - stating env['CONTENT_TYPE'] can't be nil.
rack/request.rb:44 (and possibly other places too) can't cope with env['CONTENT_TYPE'] = '' though - I think they should either test for this condition and work around it (I guess it's theoretically possible that a HTTP request might include "Content-Type: \r\n", and an easily-avoided backtrace might as well be avoided), or it should be made clear that handlers should prevent a situation where env['CONTENT_TYPE'] == nil - the easiest way probably being to add a Rack::Lint case for it.
In any event, I've patched rack-jetty and sent a pull request to the author, which prevents it from being a burning issue for me, personally, any more - it'd be nice to get it fixed up at this end too though.
from rack.
from rack.
Related Issues (20)
- Nested parameters parsing error in rack 3.0.8 HOT 22
- Cookie being created with [" prefixed to name versions 3.0 thru 3.0.8 HOT 7
- Support for `Partitioned` cookie attribute HOT 15
- can't rackup HOT 5
- Rack::Lint::LintError: Status must be >=100 seen as integer HOT 10
- How to manually decode a Rack::Session::Cookie 2023 HOT 1
- 3.0.8 Multipart PATCH requests fail in minitest(Rack::Multipart::EmptyContentError) HOT 1
- HTTP_VERSION vs SERVER_PROTOCOL and Rack::Lint HOT 5
- Spec ambiguity: environment instance HOT 11
- undefined method `[]' for nil:NilClass HOT 1
- Multiple writes to Rack::Response result in incorrect content-length header in Rack 3 HOT 4
- 3.0.9 not visible in releases nor changelog HOT 2
- RACK_INPUT not rewound on form data HOT 2
- Upgrading from rack ~> 2.2 to >= 3.0.0 required me to do a new request.body.rewind before a request.body.read HOT 2
- Rack v2.2.8 release and changelog is missing HOT 2
- how to listen host Loopback HOT 1
- Request for release - EOFError on empty multipart request HOT 6
- Support for zstd in Deflater
- Discrepancy in the parsing behavior of Rack::Multipart between versions 1.6 and 2.2 HOT 7
- Deprecation should note how to fix HOT 3
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 rack.