Skip to content
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

Merged
merged 1 commit into from
Aug 14, 2014

Conversation

sorrycc
Copy link
Contributor

@sorrycc sorrycc commented Aug 14, 2014

@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) when pulling 3213106 on sorrycc:master into 3286a14 on popomore:master.

@@ -46,7 +56,7 @@ File.prototype.getRemote = function(cb) {
var that = this;
var opt = {
gzip: true,
followRedirect: true
followRedirect: false
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个为什么改了?

Copy link
Contributor Author

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 上了。

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

还是 follow 吧,比如 http 跳 https 还是挺常见的

Copy link
Contributor Author

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

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我在家里访问的是 404 的,公司的 ip 有问题

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

在外网的 linode 服务器上试也是 302 跳淘宝。

Copy link
Owner

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

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

那先这个处理吧

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我内外网都是 302 ...

popomore added a commit that referenced this pull request Aug 14, 2014
add beforeProxy option to handle request before send to proxy
@popomore popomore merged commit fd9fd65 into popomore:master Aug 14, 2014
@popomore
Copy link
Owner

bump 0.2.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants