Skip to content

parse Accept-Encoding header loosely. #224

Merged
merged 1 commit into from Sep 7, 2011

2 participants

@kou
kou commented Aug 21, 2011

After this commit, Rack::Request#accept_encoding doesn't
raise an exception for invalid Accept-Encoding value.

If Rack::Request#accept_encoding may raise an exception,
Rack::Middleware::Deflater may also raise an exception.
Because Rack::Middleware::Deflater dosn't rescue an
exception from Rack::Request#accept_encoding.

On the exception case, it seems that either returning "400
Bad Request" or just ignoring invalid value is better
behavior. This patch uses the latter solution.

@kou kou parse Accept-Encoding header loosely.
After this commit, Rack::Request#accept_encoding doesn't
raise an exception for invalid Accept-Encoding value.

If Rack::Request#accept_encoding may raise an exception,
Rack::Middleware::Deflater may also raise an exception.
Because Rack::Middleware::Deflater dosn't rescue an
exception from Rack::Request#accept_encoding.

On the exception case, it seems that either returning "400
Bad Request" or just ignoring invalid value is better
behavior. This patch uses the latter solution.
9483488
@raggi raggi merged commit c3a1348 into rack:master Sep 7, 2011
@raggi
Official Rack repositories member
raggi commented Sep 7, 2011

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.