Closed wbyoung closed 11 years ago
Thank you! I had to change the constructor: https://github.com/ncr/rack-proxy/commit/628cbc27c83666a901ecc3c893757b72369ea230, tests were failing.
I figured that could cause problems & put it in a separate commit for that reason. It was a little confusing to me when I started using this because it seems like the standard for Rack classes is to take an app arg (first time working with Rack middleware, though, so my confusion may not mean much). Either way, it still works fine for me. Thanks for creating this!
Great to hear you like it! I haven't used rack-proxy in a long time, I don't remember why @app is not there :)
2013/8/21 Whitney Young notifications@github.com
I figured that could cause problems & put it in a separate commit for that reason. It was a little confusing to me when I started using this because it seems like the standard for Rack classes is to take an app arg (first time working with Rack middleware, though, so my confusion may not mean much). Either way, it still works fine for me. Thanks for creating this!
— Reply to this email directly or view it on GitHubhttps://github.com/ncr/rack-proxy/pull/18#issuecomment-23043087 .
Jacek Becela
http://trix.pl http://twitter.com/jacekbecela http://github.com/ncr
I'm using this middleware in Rails to set up a proxy that allows more simplified testing of an AJAX request by sending requests to the local server. Doing so allows the request to go through ruby code & to be matched via WebMock.
Basically, something like this:
api.service.com
localhost:3000/mock/api
localhost:3000/mock/api/*
, and redirects the request to hostmock.api.local
mock.api.local
This wasn't working with the streaming http requests, so I added a way of disabling them. This change should be backwards compatible for everyone who properly called super if they overrode
initialize
in their own constructor. Otherwise, it will fail to use the previous streaming logic.