Comments (9)
Can you post some more information? What do the proxy statements look like in the console? What about the request headers that are hitting your server, do they vary from what was being passed with 1.6 RC2?
from abbot.
Well here are the screenshots of the requests headers with SC 1.6RC2:
http://dl.dropbox.com/u/138776/RC2%201.png
http://dl.dropbox.com/u/138776/RC2%202.png
And here with SC 1.6 final
http://dl.dropbox.com/u/138776/Final%201.png
http://dl.dropbox.com/u/138776/Final%202.png
My buildfile is configured like this :
proxy "/backend/", :to => "www.mywebsite.com"
If I change it to use my local server (like this: proxy "/backend/", :to => "mywebsite:8888") SC 1.6 work as well as SC 1.6RC2
Let me know if you need more information.
from abbot.
I am running into this issue as well. What I have been able to determine is that if the browser sends an Accepts-Encoding header with gzip or deflate, then the request will fail with a browser error saying it can't decode the response. If gzip or deflate is not included (e.g. requesting from cURL), everything works fine.
It appears that the bug may actually be with em-http-request. What changed in SC::Rack::Proxy between RC2 and GM?
from abbot.
I’m sorry nicolasbadia, somehow I missed your response and forgot about this one. I’ll try to reproduce and fix as soon as possible.
n8mellis, the proxy was rewritten to use em-http-request to prevent blocking with long-polling requests and to support streaming APIs like Twitter.
from abbot.
publickeating, there is something going on with em-http-request such that it doesn't like gzip/deflate responses. I'm working on reducing it right now and will follow up with more info.
from abbot.
publickeating, I found the problem. When a browser sends the header "Accept-Encoding: gzip" (or deflate, compress, etc.) then the proxy is returning the proper Content-Length for the compressed content, but returning the uncompressed content in the response body. Thus the browser tries to uncompress data (because of the Content-Encoding header) that is already uncompressed (and incomplete due to the shorter Content-Length). My hunch is that the http.stream block in SC::Rack::Proxy is passing through the already uncompressed content (rather than the compressed content) while the rest of the headers "Content-Encoding" and "Content-Length" are being passed through unmodified resulting in corrupt response data. Thoughts?
from abbot.
That actually makes a lot of sense. I don’t see any way to prevent em-http from not automatically decompressing the data, but I’ve added a request for info: igrigorik/em-http-request#120
Once I hear back, we’ll either prevent the decompression if possible or else will have to massage the response headers to match the uncompressed data. Thanks a lot for figuring this out.
from abbot.
Sorry for the long turn-around time on this, I was consumed by some client support issues all the beginning of this week.
I tested it and it seems to work fine, please let me know if it fixes your issues too.
from abbot.
I am having this issue. If the content headers have "Content-Encoding:gzip", the content is deflated in the proxy, but the content length is not updated. Running CURL on the request truncates the response to Content-Length. Chrome doesn't know how to handle this and puts the request in 'other' and the response is blank.
If this is fixed in Abbot now, when will it be fixed in the gem? The current gem has this issue.
from abbot.
Related Issues (20)
- Deprecate require HOT 2
- Unable to proxy sc-server depending on mode.
- Ctrl+c doesn't always quit sc-server on OS X. HOT 5
- empty require statements clobber config:all dependencies
- Yui Compressor 2.4.8 is broken on Windows
- Bundler can't install executables
- HAML exception running sc-build
- Proxy does not support HEAD request
- Using slices (without parameters $width and $height) in a project theme can produce wrong png files HOT 1
- Debug builds still reference .handlebars, but files are renamed .js
- Spriting does not work on Windows HOT 2
- Chance fails on Windows with deep paths HOT 2
- Instructions for using abbot from source don't work HOT 1
- sc-server does not stop with ctrl-c and eats up cpu HOT 6
- Let's have a new line in the build-number command
- sc-build --target option does not include images HOT 1
- sc_require statements remains in the build
- Support for https in sc-server
- Relax the json_pure dependency's version constraint to prevent Bundler conflicts in user applications HOT 2
- Location headers on proxy POSTs badly mangle response.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from abbot.