Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
260 views
in Technique[技术] by (71.8m points)

javascript - 缺少CORS 400接头(其他问题)(CORS 400 header missing (among other issues))

This is my first project using javascript (basically forked code from here: https://www.kkhaydarov.com/audio-visualizer/ )

(这是我使用javascript的第一个项目(基本上是这里的分叉代码: https : //www.kkhaydarov.com/audio-visualizer/ ))

I'm trying to build a visualizer that responds to the audio I am hosting.

(我正在尝试构建一个可视化器,以响应我托管的音频。)

Problems: - Getting thrown a CORS 400 error (i'm using https://cors-anywhere.herokuapp.com/http:// in my source url) - Audio is not getting recognized

(问题: -抛出CORS 400错误(我在源URL中使用https://cors-anywhere.herokuapp.com/http://)-无法识别音频)

Here is a link to my project on codepen: https://codepen.io/beewash92/project/editor/ZGWOQr Code is also stored on my github: https://github.com/beewash/js-audio-visualizer

(这是我在Codepen上的项目的链接: https ://codepen.io/beewash92/project/editor/ZGWOQr代码也存储在我的github中: https : //github.com/beewash/js-audio-visualizer)

enter code here

I've scoured other posts on stackoverflow and across the web, but still running into issues.

(我在stackoverflow和整个网络上搜索了其他帖子,但仍然遇到问题。)

You're help is appreciated !

(感谢您的帮助!)

  ask by Bryan Washington translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

If you try to browse the link in chrome you will get the message as below

(如果您尝试浏览Chrome中的链接,则会收到以下消息)

Missing required request header. Must specify one of: origin,x-requested-with

You will need to define the custom request header as stated above in order for it to work.

(您需要如上所述定义自定义请求标头,以使其起作用。)

Refer the api here as it clearly stated what you should do beforehand.

(请参阅此处的api 因为它明确说明了您应该事先做的事情。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...