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

/lib/sts.js 101 行语法错误 #520

Closed
elkon028 opened this issue Aug 15, 2018 · 5 comments
Closed

/lib/sts.js 101 行语法错误 #520

elkon028 opened this issue Aug 15, 2018 · 5 comments

Comments

@elkon028
Copy link

elkon028 commented Aug 15, 2018

debug(
'response %s %s, got %s, headers: %j',
reqParams.method, reqUrl, result.status, result.headers, // 这里多了个 ','号
);
2. putObject 成功,但浏览器(360浏览器)报错:Refused to set unsafe header "User-Agent"

@luozhang002
Copy link
Contributor

luozhang002 commented Aug 15, 2018

@720t (1)针对','并不属于语法报错,其实是合理的 (2)你的这个ali-oss版本是多少,jhiesey/stream-http#91 这个其实新浏览器新特性,原因是因为我们的ali-oss依赖了第三方库stream-http,该库对UA的设置做了安全限制。后来SDK这边已经做了调整,理论上如果用的是新版本不会出现这个错的,因为SDK内部已经规避了这个问题,请排查你的版本。

@elkon028
Copy link
Author

elkon028 commented Aug 15, 2018

@luozhang002 (1)',' 问题补充
如果不去掉',' 会报以下错误(vue-cli: npm run dev 和 npm run build ):
Uncaught SyntaxError: Unexpected token ) sts.js:102 [vue-router] Failed to resolve async component default: Error: Loading chunk 0 failed. vue-router.esm.js:16 warn @ vue-router.esm.js:16 (anonymous) @ vue-router.esm.js:1763 (anonymous) @ vue-router.esm.js:1833 vue-router.esm.js:16 [vue-router] uncaught error during route navigation: warn @ vue-router.esm.js:16 abort @ vue-router.esm.js:1904 (anonymous) @ vue-router.esm.js:1947 (anonymous) @ vue-router.esm.js:1768 (anonymous) @ vue-router.esm.js:1833 vue-router.esm.js:1905 Error: Loading chunk 0 failed. at HTMLScriptElement.onScriptComplete (bootstrap a319396…:756)

(2) ali-oss版本是:6.0.1 使用 npm install --save ali-oss 安装的

请问以上问题可以解决吗?

@luozhang002
Copy link
Contributor

@720t debug这个从js语法上来说的确是没问题的,这个 ‘,’下个版本去掉,保持统一规范。但其实vue之前测试的时候,npm run dev 也是OK的

@elkon028
Copy link
Author

@luozhang002 谢谢老大

@change24
Copy link

我刚下载的新版本 还是会Refused to set unsafe header "User-Agent"
运行在360浏览器
@luozhang002

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