weixin_33693070 2020-03-29 15:57 采纳率: 0%
浏览 310

Javascript GET重定向URL

I need to make a GET call to an API endpoint that returns a redirect, I have exposed the Location using CORS but can't find any method using Ajax nor Fetch to just get the Redirect URL. If anybody could help me out that would be great.

  • 写回答

1条回答 默认 最新

  • weixin_33713707 2020-03-29 16:01
    关注

    See the fetch spec:

    Redirects (a response whose status or internal response’s (if any) status is a redirect status) are not exposed to APIs. Exposing redirects might leak information not otherwise available through a cross-site scripting attack.

    So it can't be done using browser-side JavaScript.

    评论

报告相同问题?

悬赏问题

  • ¥15 三菱变频器模块怎么检测触发
  • ¥15 在C#方法中使用了.Refresh();刷新了控件,但是不是最新值
  • ¥30 求一下解题思路,完全不懂。
  • ¥30 关于#硬件工程#的问题:求一下解题思路
  • ¥15 运筹学对偶单纯行法构造扩充问题
  • ¥20 XP系统的老电脑一开机就提示找不到rundll.exe,付费求解
  • ¥15 milvus查询出来的score怎么转换成0-1之间的相似性
  • ¥15 lvgl V9移植到linux开发板
  • ¥15 VB.net中在窗体中创建一个button控件来关闭窗体,但是提示错误,我该怎么办
  • ¥15 网上下载好的程序但是arduinoIDE编程报错,运行不了,哪里出错了,能具体给改一下吗