使用auth标头发出GET请求

时间:2022-02-26 09:40:21

I'm trying to refactor a xhr call to a different domain to something a little more portable(works only in ie if you change settings)

我正在尝试将xhr调用到不同的域重构为更便携的东西(仅适用于ie,如果你更改设置)

It's a GET request with AUTH header I want to make. There can be no user input. So far I've tried.

这是我想要的AUTH标头的GET请求。没有用户输入。到目前为止,我已经尝试过了。

<a href="http://user:pass@domain">test</a> --- won't work in ie. Works in chrome
<meta http-equiv="refresh" content="1; url=http://user:pass@domain">  --- won't work in ie. Only works in chrome

Today it uses setRequestHeader on XMLHttpRequest. Any ideas?

今天它在XMLHttpRequest上使用setRequestHeader。有任何想法吗?

1 个解决方案

#1


3  

Internet Explorer does not support user names and passwords in Web site addresses

Internet Explorer不支持网站地址中的用户名和密码

By default, versions of Windows Internet Explorer that were released starting with the release of security update 832894 do not support handling user names and passwords in HTTP and HTTP with Secure Sockets Layer (SSL) or HTTPS URLs. The following URL syntax is not supported in Internet Explorer or in Windows Explorer:

默认情况下,从安全更新832894发行版开始发布的Windows Internet Explorer版本不支持使用安全套接字层(SSL)或HTTPS URL处理HTTP和HTTP中的用户名和密码。 Internet Explorer或Windows资源管理器中不支持以下URL语法:

http(s)://username:password@server/resource.ext

there are also some "Workarounds for application and Web site developers" that should help you solving your problem.

还有一些“应用程序和网站开发人员的变通方法”可以帮助您解决问题。

also, theres a fix (download-link) that disabled this new default behavior again.

还有一个修复(download-link)再次禁用了这个新的默认行为。

#1


3  

Internet Explorer does not support user names and passwords in Web site addresses

Internet Explorer不支持网站地址中的用户名和密码

By default, versions of Windows Internet Explorer that were released starting with the release of security update 832894 do not support handling user names and passwords in HTTP and HTTP with Secure Sockets Layer (SSL) or HTTPS URLs. The following URL syntax is not supported in Internet Explorer or in Windows Explorer:

默认情况下,从安全更新832894发行版开始发布的Windows Internet Explorer版本不支持使用安全套接字层(SSL)或HTTPS URL处理HTTP和HTTP中的用户名和密码。 Internet Explorer或Windows资源管理器中不支持以下URL语法:

http(s)://username:password@server/resource.ext

there are also some "Workarounds for application and Web site developers" that should help you solving your problem.

还有一些“应用程序和网站开发人员的变通方法”可以帮助您解决问题。

also, theres a fix (download-link) that disabled this new default behavior again.

还有一个修复(download-link)再次禁用了这个新的默认行为。