-
Notifications
You must be signed in to change notification settings - Fork 147
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
Add support for proxy servers (e.g. Nginx) URI rewrites #137
Add support for proxy servers (e.g. Nginx) URI rewrites #137
Conversation
use #original_uri instead of #request_uri if any value returned from the former added RubyMine .idea folder to .gitignore
@kjg did you have a chance to take a look? |
Thanks so much for taking the time to make a PR for this! I've been going
through a job transition and haven't had time to look at this yet, but
hopefully I'll have some time as soon as things start to settle down.
…On December 6, 2016 at 4:20:28 AM, Mattia ***@***.***) wrote:
@kjg <https://github.com/kjg> did you have a chance to take a look?
Unfortunately tests are failing because Faraday 0.10 was release without
support for ruby 1.8.7, so not related to my changes 😄
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#137 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAAInR7hZpTr9p_6z0EOCyBnEDP3a8Tpks5rFTbsgaJpZM4K-GGC>
.
|
Hi @kjg no worries I'm a maintainer as well (of Faraday, btw) so I know how it is :)
In Faraday, we decided to go for the 2nd choice as always more dependencies were dropping the support as well and to embrace the syntax improvements available in new versions. |
I think with the next major release it might make sense to drop support for 1.8.7 |
By major do you mean 3.0? |
…ure/support-uri-rewrite-header
@mgomes @kjg I noticed you decided to change Faraday version according to the ruby version (which fixes the issue I was having with tests) and released a new version of the gem, but since you didn't tell me my PR remained behind 😞 I've now pulled changes from master into my branch and pushed again. I think we're there and at this point it really takes nothing to review and merge my branch in. |
can you please either rebase this against master or give me Push access on the PR by clicking the "Allow edits from maintainers" checkbox? I think I've fixed the travis failure. Thanks for your patients and for the PR! |
Thanks @kjg I'll try to rebase now and push the changes 👍 |
…ure/support-uri-rewrite-header
@kjg looks like your fix worked 😃! |
use #original_uri instead of #request_uri if any value returned from the former added RubyMine .idea folder to .gitignore
* master: (96 commits) Bump to v2.2.1 Bump to version 2.2.0 Add http.rb request driver (mgomes#164) [CI] Test against Ruby 2.5 Fix mgomes#152 and 125 Update rubocop configuration Update dependencies Add Rails 5.1 tests Change return type for request #content_md5 #timestamp #content_type uri edge case having another uri mention bundle_gemfile in readme Allow clock skew to be user-defined (mgomes#136) Drop support ruby 1.x, rails 2.x, rails 3.x (mgomes#141) adds #original_uri method to all request drivers (mgomes#137) Disable the Metrics/BlockLength cop in specs Update to latest bundler in travis before tests Fix faraday on ruby 1.8 Update to v2.1.0 for feature release Add new test for far future requests Fix incorrect behaviour introduced with the request_too_old name change ...
This addresses the issue highlighted in #95 .
I went for the header
X-ORIGINAL-URI
as this is a standard for proxy servers (in primis Nginx).I've also added a test to show that the new test is working (plus, I've tested it with our application and is now working fine 👍 ).
If you need to configure Nginx to make this working, you just need to add:
@kjg On a sidenote, while working on the code I realised that the
request_drivers
folder could be refactored as most of the implementation are just a copy-and-paste of the same methods.Maybe it would be a good idea to introduce a superclass like
BaseDriver
and make all drivers inheriting from it? Im sure it would save a good amount of code