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

iojs QueryString escape bug #133

Closed
willin opened this issue Mar 21, 2015 · 3 comments
Closed

iojs QueryString escape bug #133

willin opened this issue Mar 21, 2015 · 3 comments

Comments

@willin
Copy link

willin commented Mar 21, 2015

Error report

TypeError: undefined is not a function
    at Object.QueryString.escape (querystring.js:101:13)
    at Object.makeBaseUrl (/Users/willin/app/node_modules/qiniu/qiniu/rs.js:242:29)
    at downloadAction (/Users/willin/app/App/Lib/Controller/Version/LogController.js:44:27)
    at /Users/willin/app/node_modules/thinkjs/lib/Lib/Core/App.js:118:30

file at qiniu/qiniu/rs.js

line 243

// query like '-thumbnail', '?imageMogr2/thumbnail/960x' and so on
function makeBaseUrl(domain, key, query) {
  key = new Buffer(key);
  return 'http://' + domain + '/' + querystring.escape(key) + (query||'');
}

Escape param should be a string.

// query like '-thumbnail', '?imageMogr2/thumbnail/960x' and so on
function makeBaseUrl(domain, key, query) {
  //key = new Buffer(key);
  return 'http://' + domain + '/' + querystring.escape(key) + (query||'');
}

will be ok.

@longbai
Copy link
Contributor

longbai commented Mar 22, 2015

收到,我看下

@willin
Copy link
Author

willin commented Mar 23, 2015

@longbai 也许这个问题是由于 io.js 1.6.0 querystring的一些缺陷引起.
在1.6.1 CHANGELOG上看到修复一些问题不知道是否对其产生影响

@forrest-mao
Copy link
Contributor

@willin 用2.4.0的io.js目前测试没有出现类似的异常反馈,可以尝试做下升级

@longbai longbai closed this as completed Aug 24, 2015
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

No branches or pull requests

3 participants