Soundcloud的oEmbed端点在某些URL上返回403 [英] Soundcloud's oEmbed endpoint returns 403 on some URLs

查看:111
本文介绍了Soundcloud的oEmbed端点在某些URL上返回403的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Soundcloud的oEmbed端点适用于大多数链接(例如 knifepartyinc

Soundcloud's oEmbed endpoint works well with most links (e.g. affee), but returns a 403 status with the following (valid) URL: knifepartyinc

第二个URL有什么问题?

What is wrong with the second URL?

推荐答案

SoundCloud上曲目的所有者可以选择禁用所有小部件.这是音轨编辑页面上的大复选框之一.在这种情况下,oEmbed将无法返回嵌入代码.您的应用程序应采用防御方法来处理此问题.只需在DOM中呈现响应之前检查响应是否正确即可.

the owner of the track on SoundCloud can choose to disable all widgets. It's one of the big checkboxes on the track edit page. In such case oEmbed wouldn't be able to return an embed code. Your application should have a defensive approach to handle this. Just check if the response is true before rendering it in the DOM.

这篇关于Soundcloud的oEmbed端点在某些URL上返回403的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆