stormbrew / rack-jetty

Very simple (mostly Ruby) implementation of jetty as a pure Rack adapter.
MIT License
14 stars 6 forks source link

Fix for Content-Type in the rack environment #1

Closed lupine closed 13 years ago

lupine commented 13 years ago

Hi Graham,

rack-jetty triggers this behaviour in Rack: https://github.com/rack/rack/issues#issue/40

Although a monkey-patch in Rack will fix the issue, and it's conceivable that they should fix things on their side too, at the moment it expects content_type to be either unset (Rack::Lint complains if if env['CONTENT_TYPE'] is present but nil) or a non-empty string (since Rack::Request#media_type kicks out an exception if it's '')

I've put together a commit that addresses the issue in rack-jetty and makes its behaviour w/rt Content-Type the same as the other handlers - if you think it's appropriate, could you accept the pull request and put out a new version of the gem?

I'm just starting to put together an application based on sinatra > rack > rack-jetty > jruby & it'd be nice to avoid the monkey-patching if possible :)

Thanks!

stormbrew commented 13 years ago

Awesome. Thanks for the patch. I've just pushed it out with another patch someone submitted quite a while ago that relates to image serving breaking. Always makes me happy when people fix what I made. :)

lupine commented 13 years ago

Thanks very much for the new release - I'm using it without problems now :).

Next step is getting the Jetty server to log to a Ruby logger... fun (not!)... if I get it working, I shall send you another pull request.