-
Notifications
You must be signed in to change notification settings - Fork 4
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 beforeProxy option to handle request before send to proxy #2
Conversation
@@ -46,7 +56,7 @@ File.prototype.getRemote = function(cb) { | |||
var that = this; | |||
var opt = { | |||
gzip: true, | |||
followRedirect: true | |||
followRedirect: false |
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.
这个为什么改了?
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.
a.alipayobjects.com/notfound.js
早上访问这个被 redirect 到 err.taobao.com 上了。
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.
还是 follow 吧,比如 http 跳 https 还是挺常见的
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.
改成可配置? follow 的话不如现在用不了,会把 html 合并回来。
$ curl -I https://a.alipayobjects.com/b.js
HTTP/1.1 302 Found
Server: Tengine
Date: Thu, 14 Aug 2014 04:51:51 GMT
Content-Type: text/html
Content-Length: 258
Connection: keep-alive
Location: http://err.taobao.com/error1.html
Expires: Fri, 14 Aug 2015 04:51:51 GMT
Cache-Control: max-age=31536000
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.
我在家里访问的是 404 的,公司的 ip 有问题
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.
在外网的 linode 服务器上试也是 302 跳淘宝。
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.
发现我才是内网,cdn 的处理好奇怪
☖ curl -I https://a.alipayobjects.com/b.js
HTTP/1.1 404 Not Found
Server: spanner/1.0.6
Date: Thu, 14 Aug 2014 05:02:57 GMT
Content-Type: text/html
Content-Length: 590
Connection: keep-alive
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.
那先这个处理吧
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.
我内外网都是 302 ...
add beforeProxy option to handle request before send to proxy
bump 0.2.6 |
spmjs/spm-server#4