fix: don't hardcode websockets port in csp config

Allows using websocket on other ports specified in the VITE_ECHO_ADDRESS env variable.
This commit is contained in:
Roardom
2025-05-27 20:36:08 +00:00
parent 1672d70d44
commit 777cab49fa
2 changed files with 3 additions and 3 deletions

View File

@@ -487,8 +487,8 @@ return [
'self' => true,
'allow' => [
'https://'.parse_url(env('APP_URL'), PHP_URL_HOST).':8443/socket.io/',
'wss://'.parse_url(env('APP_URL'), PHP_URL_HOST).':8443/socket.io/',
'https://'.parse_url(env('VITE_ECHO_ADDRESS'), PHP_URL_HOST).(parse_url(env('VITE_ECHO_ADDRESS'), PHP_URL_PORT) === null ? '' : ':'.parse_url(env('VITE_ECHO_ADDRESS'), PHP_URL_PORT)).'/socket.io/',
'wss://'.parse_url(env('VITE_ECHO_ADDRESS'), PHP_URL_HOST).(parse_url(env('VITE_ECHO_ADDRESS'), PHP_URL_PORT) === null ? '' : ':'.parse_url(env('VITE_ECHO_ADDRESS'), PHP_URL_PORT)).'/socket.io/',
'https://api.themoviedb.org/',
],
],

View File

@@ -867,7 +867,7 @@ parameters:
-
message: '#^Parameter \#1 \$url of function parse_url expects string, bool\|string\|null given\.$#'
identifier: argument.type
count: 2
count: 6
path: config/secure-headers.php
-