From 1fdc795ccac076b6833cf8deab8605a40e1429a1 Mon Sep 17 00:00:00 2001 From: Andi Pieper Date: Mon, 7 Oct 2024 14:45:37 +0200 Subject: [PATCH 1/2] added deprecation header to all requests to the obs api --- src/js/observatories/http.js | 9 +++++++++ src/js/statistics.js | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/src/js/observatories/http.js b/src/js/observatories/http.js index 82f29d7..fec0084 100644 --- a/src/js/observatories/http.js +++ b/src/js/observatories/http.js @@ -412,6 +412,9 @@ const loadHostHistory = async () => { state.history = data; insertHostHistory(); }, + headers: { + 'Deprecation-Override': 'yes' + }, url: API_URL }); }; @@ -496,6 +499,9 @@ const handle = async scan => { loadHostHistory(); insert(this.scan, data); }, + headers: { + 'Deprecation-Override': 'yes' + }, url: constants.urls.api + 'getScanResults?scan=' + scan.scan_id.toString() }); } @@ -521,6 +527,9 @@ const submit = async (hostname, successCallback, errorCallback, method, rescan, error: errorCallback, method: method, success: successCallback, + headers: { + 'Deprecation-Override': 'yes' + }, url: constants.urls.api + 'analyze?host=' + hostname }; diff --git a/src/js/statistics.js b/src/js/statistics.js index e034a4d..b5005e6 100644 --- a/src/js/statistics.js +++ b/src/js/statistics.js @@ -171,6 +171,9 @@ export const load = async () => { $('#results-reveal-container').remove(); }, success: function s(data) { insertHTTP(data); }, + headers: { + 'Deprecation-Override': 'yes' + }, url: constants.urls.api + '__stats__' }); @@ -180,6 +183,9 @@ export const load = async () => { // remove stats section }, success: function s(data) { insertSSH(data); }, + headers: { + 'Deprecation-Override': 'yes' + }, url: constants.urls.ssh + 'stats' }); @@ -188,6 +194,9 @@ export const load = async () => { // remove stats section }, success: data => insertTLS(data), + headers: { + 'Deprecation-Override': 'yes' + }, url: constants.urls.tls + '__stats__?format=json' }); }; From 756752ef19894f48cc7a9be0321b9f7bf5ee55c3 Mon Sep 17 00:00:00 2001 From: Andi Pieper Date: Mon, 7 Oct 2024 15:41:00 +0200 Subject: [PATCH 2/2] make it X-Deprecation-Override --- src/js/observatories/http.js | 6 +++--- src/js/statistics.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/js/observatories/http.js b/src/js/observatories/http.js index fec0084..b4f32a5 100644 --- a/src/js/observatories/http.js +++ b/src/js/observatories/http.js @@ -413,7 +413,7 @@ const loadHostHistory = async () => { insertHostHistory(); }, headers: { - 'Deprecation-Override': 'yes' + 'X-Deprecation-Override': 'yes' }, url: API_URL }); @@ -500,7 +500,7 @@ const handle = async scan => { insert(this.scan, data); }, headers: { - 'Deprecation-Override': 'yes' + 'X-Deprecation-Override': 'yes' }, url: constants.urls.api + 'getScanResults?scan=' + scan.scan_id.toString() }); @@ -528,7 +528,7 @@ const submit = async (hostname, successCallback, errorCallback, method, rescan, method: method, success: successCallback, headers: { - 'Deprecation-Override': 'yes' + 'X-Deprecation-Override': 'yes' }, url: constants.urls.api + 'analyze?host=' + hostname }; diff --git a/src/js/statistics.js b/src/js/statistics.js index b5005e6..35ec1d7 100644 --- a/src/js/statistics.js +++ b/src/js/statistics.js @@ -172,7 +172,7 @@ export const load = async () => { }, success: function s(data) { insertHTTP(data); }, headers: { - 'Deprecation-Override': 'yes' + 'X-Deprecation-Override': 'yes' }, url: constants.urls.api + '__stats__' }); @@ -184,7 +184,7 @@ export const load = async () => { }, success: function s(data) { insertSSH(data); }, headers: { - 'Deprecation-Override': 'yes' + 'X-Deprecation-Override': 'yes' }, url: constants.urls.ssh + 'stats' }); @@ -195,7 +195,7 @@ export const load = async () => { }, success: data => insertTLS(data), headers: { - 'Deprecation-Override': 'yes' + 'X-Deprecation-Override': 'yes' }, url: constants.urls.tls + '__stats__?format=json' });