New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Making proxy to be compliant with Sinatra 1.4.2 release #73
Conversation
Ok I have tracked down what is our minimum version for my patch (search for "accept?"):
https://github.com/sinatra/sinatra/blob/master/CHANGES Is this acceptable? |
+1, fixes it for me on sinatra 1.4.3 and 1.3.2. |
1.3.0's not going to be old enough for our RHEL 6 install, which has rubygem-sinatra 1.0.2 from EPEL. |
Let me do a monkey patch for older Sinatra versions. |
Here it comes, tested with Sinatra 1.2.9 and 1.4.2. |
[test] |
@lzap does it mean that 1.2.9 also represents 1.02? |
accept.include? type | ||
end | ||
end | ||
Request.send :include, MonkeyRequest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldnt this be restricted based on sinatra version?
Right that is better. Rebased. [test] |
merged - thanks |
This change in Sinatra 1.4.2
https://github.com/sinatra/sinatra/pull/626/files
introduces new class AcceptEntry which is used for comparison of the accept
flag. Since we use request.accept.include? it does not work anymore on my
system:
This patch changes all places where we use this comparison and changes it to
the standard way. This should be compatible across old Sinatra versions, but
please confirm this explicitly.