mirror of
https://github.com/OutlineFoundation/outline-server.git
synced 2026-10-24 05:21:49 +00:00
Stop using any
This commit is contained in:
parent
57c27e3a40
commit
cff86bc3ff
1 changed files with 3 additions and 4 deletions
|
|
@ -147,9 +147,8 @@ function getWebAppUrl() {
|
|||
// status code and inject CORS response headers.
|
||||
function workaroundDigitalOceanApiCors() {
|
||||
const headersFilter = {urls: ['https://api.digitalocean.com/*']};
|
||||
electron.session.defaultSession.webRequest.onHeadersReceived(
|
||||
// tslint:disable-next-line:no-any
|
||||
headersFilter, (details: electron.OnHeadersReceivedListenerDetails, callback: (response: any) => void) => {
|
||||
electron.session.defaultSession.webRequest.onHeadersReceived(headersFilter,
|
||||
(details: electron.OnHeadersReceivedListenerDetails, callback: (response: electron.CallbackResponse) => void) => {
|
||||
if (details.method === 'OPTIONS') {
|
||||
details.responseHeaders['access-control-allow-origin'] = 'outline://web_app';
|
||||
if (details.statusCode === 403) {
|
||||
|
|
@ -165,7 +164,7 @@ function workaroundDigitalOceanApiCors() {
|
|||
details.responseHeaders['access-control-max-age'] = '86400';
|
||||
}
|
||||
}
|
||||
callback(details);
|
||||
callback(details as electron.CallbackResponse);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue