我正在使用来自firebase的bitnami版本的elasticsearch。我发现当我使用邮递员尝试时,它只会连接到http
而不是https
。我的create-react-app
已部署到firebase,当我尝试使用Mixed Content:
库获取数据时出现axios
错误。
这里是我的代码:
import axios from 'axios';
axios.get('http://xx.xxx.xx.xxx//elasticsearch/tasks/task/_search?default_operator=AND&q=*', {
httpsAgent: agent,
method: 'get',
headers: {
// 'Content-Type': 'application/json',
'Authorization': 'Basic xxxxxxxxxx='
}
});
和错误
Mixed Content: The page at 'https://xxx-xxxx.firebaseapp.com/tasks' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://xx.xxx.xx.xxx//elasticsearch/tasks/task/_search?default_operator=AND&q=*'. This content should also be served over HTTPS.