Skip to content

Commit

Permalink
request filter: whitelist "storage" subdomain, #312, closes #508
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimiry committed Apr 22, 2022
1 parent 7abf23e commit 7b80882
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "electron-mail",
"description": "Unofficial ProtonMail Desktop App",
"version": "4.15.0",
"version": "4.15.1",
"author": "Vladimir Yakovlev <desktop-app@protonmail.ch>",
"license": "GPL-3.0",
"homepage": "/~https://github.com/vladimiry/ElectronMail",
Expand Down
4 changes: 4 additions & 0 deletions src/electron-main/web-request/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ export function initWebRequestListenersByAccount(
...STATIC_ALLOWED_ORIGINS,
webClient.entryApiUrl,
webClient.entryUrl,
((): string => {
const {hostname, protocol} = new URL(webClient.entryApiUrl);
return `${protocol}//storage.${hostname.split(".").slice(-2).join(".")}`; // proton-drive specific endpoint
})(),
].map(parseUrlOriginWithNullishCheck);

// according to electron docs "only the last attached listener will be used" so no need to unsubscribe previously registered handlers
Expand Down

0 comments on commit 7b80882

Please sign in to comment.