Closed SerinaNya closed 4 years ago
这些 API 并不是给前端用的。
但是没说不可以给前端用
是没有说不可以,但这个特性是「不必要」的,加了也没带来多大的好处。
会有什么坏处?
没带来多大的好处 != 有坏处
既然这样,那就加呗。 我就是你这个意思
我是说,我不觉得有加的必要性。
Mojang 也没有在官方的 Yggdrasil API 加 Access-Control-Allow-Access
。
感觉这个更应该由皮肤站来做,有需要的皮肤站自己加上。
那就当成兼容前端查询吧,CSL 的 API 不就有跨域头么
并没有。
宁好,有
您找演示站试试。
您找演示站试试。
那个的确没有,但是你也知道,演示站过时了
有是有, 但不是直接使用 *
的吧
这与演示站过时与否没有关系,因为这部分代码基本没改变过,你自己搭建一个皮肤站就知道。
:thinking: 我认为,加上这个头也不会有什么负面影响,反而能给一些(即使不多)开发者带来好处,何乐而不为?
LittleSkin 也没有。
感觉这个更应该由皮肤站来做,有需要的皮肤站自己加上。
解决这个问题的更好方法是自己搭建 API 代理。
加上这个头也不会有什么负面影响
这意味这个 API 可以被跨站请求,不能保证没有负面影响。
LittleSkin 也没有。
感觉这个更应该由皮肤站来做,有需要的皮肤站自己加上。
解决这个问题的更好方法是自己搭建 API 代理。
加上这个头也不会有什么负面影响
这意味这个 API 可以被跨站请求,不能保证没有负面影响。
可按照目前的认知来看,的确没有任何威胁
解决这个问题的更好方法是自己搭建 API 代理。
解决这个问题的更好方法是自己搭建 API 代理。
牺牲了速度,加大了成本。
那您自行 fork 这个插件吧。(反正是开源的)
其实也不需要 fork,自己写个插件,然后注册一个中间件并在中间件里修改头部同样是一个可行的办法。
我去琢磨琢磨 :thinking:
@jinzhijie
一样的。我没有故意加减 Access-Control-Allow-Origin
。你也可以直接翻阅 BS 对应部分的代码。
一样的。我没有故意加减
Access-Control-Allow-Origin
。你也可以直接翻阅 BS 对应部分的代码。
:thinking: @tnqzh123
accept-ranges: bytes
access-control-allow-origin: *
cache-control: max-age=600
content-length: 220
content-type: application/json
date: Fri, 03 Apr 2020 02:32:21 GMT
etag: "5dd619f2-dc"
expires: Fri, 03 Apr 2020 02:42:21 GMT
last-modified: Thu, 21 Nov 2019 05:00:34 GMT
server: NWS_SP
status: 200
x-cache-lookup: Hit From Upstream
x-cache-lookup: Hit From Disktank3
x-daa-tunnel: hop_count=2
x-nws-log-uuid: 97c4779e-bd32-4ba2-a97c-0e8fde3e4ce4
x-nws-uuid-verify: 48c0ca4799af7b46a238ac70f15b855e
有关 LittleSkin 的问题请私下交流,在这里讨论会导致很多人收到通知的。
好的
Xiao_Jin jinzhijie0916@qq.com
------------------ 原始邮件 ------------------ 发件人: "Pig Fang"<notifications@github.com>; 发送时间: 2020年4月3日(星期五) 上午10:44 收件人: "bs-community/yggdrasil-api"<yggdrasil-api@noreply.github.com>; 抄送: "Xiao_Jin"<742905606@qq.com>; "Mention"<mention@noreply.github.com>; 主题: Re: [bs-community/yggdrasil-api] [feature request] 在 API 中添加跨域响应头 (#31)
有关 LittleSkin 的问题请私下交流,在这里讨论会导致很多人收到通知的。
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
目前的 Yggdrasil API 没有跨域响应头,导致前端请求时报
Network Error
希望 Yggdrasil API 在返回数据时添加上跨域头
Access-Control-Allow-Origin: *
,以达到在前端直接请求 API 的目的