Skip to content

Commit 14df6c2

Browse files
committed
CORS proxy now seems to require x-requested-with header
1 parent a43dc32 commit 14df6c2

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

apps/model_catalog/src/Introduction.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,14 @@ class Introduction extends React.Component {
204204

205205
componentDidMount() {
206206
this.mounted = true;
207+
const headers = {
208+
//'origin: ?,
209+
'x-requested-with': 'XMLHttpRequest',
210+
};
207211
fetch(
208212
corsProxy +
209-
"https://object.cscs.ch/v1/AUTH_c0a333ecf7c045809321ce9d9ecdfdea/VF_paper_demo/vf_stats/models_stats.json"
213+
"https://object.cscs.ch/v1/AUTH_c0a333ecf7c045809321ce9d9ecdfdea/VF_paper_demo/vf_stats/models_stats.json",
214+
{ headers }
210215
)
211216
.then((response) => response.json())
212217
.then((jsonData) => {

apps/model_catalog/src/ResultRelatedFiles.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ class ResultFile extends React.Component {
6565
if (this.state.url.includes("drive.ebrains.eu")) {
6666
config["headers"] = {
6767
Authorization: "Bearer " + this.state.auth.token,
68+
'x-requested-with': 'XMLHttpRequest',
6869
};
6970
const url_parts = this.state.url.match(".*/lib/(.*)/file(/.*)");
7071
query_url =

apps/model_catalog/src/globals-staging.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ export const queryValid = [
4646
export const ADMIN_PROJECT_ID = "model-validation";
4747

4848
// Since Collaboratory v2 storage and CSCS storage gives CORS related issues
49-
export const corsProxy = "https://corsproxy.hbpneuromorphic.eu/";
50-
// previously used https://corsproxy-sa.herokuapp.com/, https://cors-anywhere.herokuapp.com/ - but now has request limits
51-
// other options: https://cors-clear.herokuapp.com/, https://cors-fixer.herokuapp.com/, https://cors-handler.herokuapp.com/
49+
export const corsProxy = "https://corsproxy.apps.tc.humanbrainproject.eu/";
5250

5351
export const updateHash = (value) => {
5452
window.location.hash = value;

apps/model_catalog/src/globals.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ export const queryValid = [
4646
export const ADMIN_PROJECT_ID = "model-validation";
4747

4848
// Since Collaboratory v2 storage and CSCS storage gives CORS related issues
49-
export const corsProxy = "https://corsproxy.hbpneuromorphic.eu/";
50-
//export const corsProxy = "https://corsproxy.apps.tc.humanbrainproject.eu/";
49+
export const corsProxy = "https://corsproxy.apps.tc.humanbrainproject.eu/";
5150

5251
export const updateHash = (value) => {
5352
window.location.hash = value;

0 commit comments

Comments
 (0)