Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
Merge pull request #316 from mozilla/MP-1556-deprecation-header
Browse files Browse the repository at this point in the history
feat(deprecation): Add `X-Deprecation-Override` header to requests to the API
  • Loading branch information
argl authored Oct 9, 2024
2 parents 93e2e8f + 756752e commit 61448f4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/js/observatories/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,9 @@ const loadHostHistory = async () => {
state.history = data;
insertHostHistory();
},
headers: {
'X-Deprecation-Override': 'yes'
},
url: API_URL
});
};
Expand Down Expand Up @@ -496,6 +499,9 @@ const handle = async scan => {
loadHostHistory();
insert(this.scan, data);
},
headers: {
'X-Deprecation-Override': 'yes'
},
url: constants.urls.api + 'getScanResults?scan=' + scan.scan_id.toString()
});
}
Expand All @@ -521,6 +527,9 @@ const submit = async (hostname, successCallback, errorCallback, method, rescan,
error: errorCallback,
method: method,
success: successCallback,
headers: {
'X-Deprecation-Override': 'yes'
},
url: constants.urls.api + 'analyze?host=' + hostname
};

Expand Down
9 changes: 9 additions & 0 deletions src/js/statistics.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ export const load = async () => {
$('#results-reveal-container').remove();
},
success: function s(data) { insertHTTP(data); },
headers: {
'X-Deprecation-Override': 'yes'
},
url: constants.urls.api + '__stats__'
});

Expand All @@ -180,6 +183,9 @@ export const load = async () => {
// remove stats section
},
success: function s(data) { insertSSH(data); },
headers: {
'X-Deprecation-Override': 'yes'
},
url: constants.urls.ssh + 'stats'
});

Expand All @@ -188,6 +194,9 @@ export const load = async () => {
// remove stats section
},
success: data => insertTLS(data),
headers: {
'X-Deprecation-Override': 'yes'
},
url: constants.urls.tls + '__stats__?format=json'
});
};
Expand Down

0 comments on commit 61448f4

Please sign in to comment.