diff options
author | Chocobozzz <me@florianbigard.com> | 2022-03-17 09:09:06 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-03-17 09:09:06 +0100 |
commit | 2769876fb26742f5cc8aa4b761be7bafca97d18d (patch) | |
tree | 250988e78313840b15f925a40d20c7109adb4ab5 /shared | |
parent | 52fe4b671a20c37ae46cf88d175dd16cddfc4de7 (diff) | |
download | PeerTube-2769876fb26742f5cc8aa4b761be7bafca97d18d.tar.gz PeerTube-2769876fb26742f5cc8aa4b761be7bafca97d18d.tar.zst PeerTube-2769876fb26742f5cc8aa4b761be7bafca97d18d.zip |
Fix client html cache on theme update
Diffstat (limited to 'shared')
-rw-r--r-- | shared/server-commands/server/config-command.ts | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/shared/server-commands/server/config-command.ts b/shared/server-commands/server/config-command.ts index e47a0d346..1dd6e1ea4 100644 --- a/shared/server-commands/server/config-command.ts +++ b/shared/server-commands/server/config-command.ts | |||
@@ -123,6 +123,21 @@ export class ConfigCommand extends AbstractCommand { | |||
123 | }) | 123 | }) |
124 | } | 124 | } |
125 | 125 | ||
126 | async getIndexHTMLConfig (options: OverrideCommandOptions = {}) { | ||
127 | const text = await this.getRequestText({ | ||
128 | ...options, | ||
129 | |||
130 | path: '/', | ||
131 | implicitToken: false, | ||
132 | defaultExpectedStatus: HttpStatusCode.OK_200 | ||
133 | }) | ||
134 | |||
135 | const match = text.match('<script type="application/javascript">window.PeerTubeServerConfig = (".+?")</script>') | ||
136 | |||
137 | // We parse the string twice, first to extract the string and then to extract the JSON | ||
138 | return JSON.parse(JSON.parse(match[1])) as ServerConfig | ||
139 | } | ||
140 | |||
126 | getAbout (options: OverrideCommandOptions = {}) { | 141 | getAbout (options: OverrideCommandOptions = {}) { |
127 | const path = '/api/v1/config/about' | 142 | const path = '/api/v1/config/about' |
128 | 143 | ||