Skip to content

Commit

Permalink
rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
ChengjieLi28 committed Dec 7, 2023
1 parent 0baced1 commit 651c321
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions xinference/web/ui/src/components/fetcher.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// Some users use https proxies for backend service such as nginx.
// So if the url has a https prefix, add a special header to avoid `Mixed Content` issue.
function updateOptions(url, options) {
const update = { ...options };
if (url.startsWith("https://")) {
const update = { ...options }
if (url.startsWith('https://')) {
update.headers = {
...update.headers,
"Content-Security-Policy": "upgrade-insecure-requests",
};
'Content-Security-Policy': 'upgrade-insecure-requests',
}
}
return update;
return update
}

export default function fetcher(url, options) {
return fetch(url, updateOptions(url, options));
return fetch(url, updateOptions(url, options))
}

0 comments on commit 651c321

Please sign in to comment.