mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-03-21 17:50:29 -05:00
Fix new side server URL scheme
Some checks failed
Node.js CI / build (22.x) (push) Has been cancelled
Some checks failed
Node.js CI / build (22.x) (push) Has been cancelled
Mostly, this adds backwards compatibility with the `localhost-[port].psim.us` URLs, which never stopped working.
This commit is contained in:
parent
4b5830ff39
commit
87a8997278
|
|
@ -18,13 +18,12 @@ RewriteEngine on
|
|||
|
||||
RewriteCond %{HTTP:X-Forwarded-Proto} ^http$
|
||||
RewriteCond %{HTTP_HOST} ^play\.pokemonshowdown\.com$ [NC]
|
||||
RewriteCond %{QUERY_STRING} !^insecure [NC]
|
||||
RewriteRule ^([A-Za-z0-9-]*)$ https://play.pokemonshowdown.com/$1 [R=307,NE,L]
|
||||
|
||||
RewriteCond %{HTTP:X-Forwarded-Proto} ^https$
|
||||
RewriteCond %{HTTP_HOST} ^play\.pokemonshowdown\.com$ [NC]
|
||||
RewriteCond %{QUERY_STRING} ^insecure [NC]
|
||||
RewriteRule ^([A-Za-z0-9-]*)$ http://play.pokemonshowdown.com/$1 [R=307,NE,L]
|
||||
RewriteRule ^([A-Za-z0-9-]*)$ http://insecure.psim.us/$1 [R=307,NE,L]
|
||||
|
||||
# redirects (keep in sync with client.js)
|
||||
RewriteRule ^appeals?\/?$ https://play.pokemonshowdown.com/view-help-request--appeal [R=302,L]
|
||||
|
|
|
|||
|
|
@ -108,6 +108,7 @@ var yourOrigin = <?php echo json_encode($protocol . '//' . $host) ?>;
|
|||
var myOrigin = 'https://<?php echo $psconfig['routes']['client'] ?>';
|
||||
|
||||
if (config.host) {
|
||||
config.host = config.host.replace(/^localhost-([0-9]+)$/, 'localhost--$1');
|
||||
if (!config.host.includes('.')) {
|
||||
// parse
|
||||
config.host = config.host.replace(/\b----\b/g, '::').replace(/---/g, '=').replace(/--/g, ':').replace(/-/g, '.').replace(/=/g, '-');
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user