mirror of
https://github.com/koush/scrypted.git
synced 2026-02-03 14:13:28 +00:00
cloud: send custom domain header if its in use
This commit is contained in:
4
plugins/cloud/package-lock.json
generated
4
plugins/cloud/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@scrypted/cloud",
|
||||
"version": "0.2.15",
|
||||
"version": "0.2.17",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@scrypted/cloud",
|
||||
"version": "0.2.15",
|
||||
"version": "0.2.17",
|
||||
"dependencies": {
|
||||
"@eneris/push-receiver": "^3.1.5",
|
||||
"@scrypted/common": "file:../../common",
|
||||
|
||||
@@ -53,5 +53,5 @@
|
||||
"@types/nat-upnp": "^1.1.5",
|
||||
"@types/node": "^20.14.6"
|
||||
},
|
||||
"version": "0.2.15"
|
||||
"version": "0.2.17"
|
||||
}
|
||||
|
||||
@@ -888,7 +888,11 @@ class ScryptedCloud extends ScryptedDeviceBase implements OauthClient, Settings,
|
||||
this.proxy.on('proxyRes', (res, req) => {
|
||||
res.headers['X-Scrypted-Cloud'] = req.headers['x-scrypted-cloud'];
|
||||
res.headers['X-Scrypted-Direct-Address'] = req.headers['x-scrypted-direct-address'];
|
||||
res.headers['X-Scrypted-Cloud-Address'] = this.cloudflareTunnel;
|
||||
let domain: string;
|
||||
if (this.storageSettings.values.forwardingMode === 'Custom Domain' && this.storageSettings.values.hostname)
|
||||
domain = `https://${this.storageSettings.values.hostname}`;
|
||||
domain ||= this.cloudflareTunnel;
|
||||
res.headers['X-Scrypted-Cloud-Address'] = domain;
|
||||
res.headers['Access-Control-Expose-Headers'] = 'X-Scrypted-Cloud, X-Scrypted-Direct-Address, X-Scrypted-Cloud-Address';
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user