fix: correct URL format in docker-compose files and improve viewport handling in index.php
All checks were successful
Build Container / docker (push) Successful in 28s
All checks were successful
Build Container / docker (push) Successful in 28s
This commit is contained in:
@@ -13,6 +13,6 @@ services:
|
||||
- ./logs:/srv/logs
|
||||
|
||||
environment:
|
||||
- URL=http://localhost:8080
|
||||
- URL=http://localhostxxx:8080
|
||||
ports:
|
||||
- 8080:80
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
version: '3.3'
|
||||
services:
|
||||
http2pic:
|
||||
image: gitea.haschek.at/haschek-solutions/http2pic:2
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
- ./cache:/srv/cache
|
||||
- ./logs:/srv/logs
|
||||
environment:
|
||||
- URL=http://localhost:8080
|
||||
ports:
|
||||
|
||||
@@ -30,7 +30,7 @@ switch ($url[0]) {
|
||||
}
|
||||
$ip = getUserIP();
|
||||
|
||||
$viewport = $_REQUEST['viewport'] ?? '1024x768';
|
||||
$viewport = $_REQUEST['viewport'] ?: '1024x768';
|
||||
if (!preg_match('/^\d+x\d+$/', $viewport)) {
|
||||
header('HTTP/1.0 400 Bad Request');
|
||||
echo 'Invalid viewport format. Use WIDTHxHEIGHT (e.g., 1024x768)';
|
||||
@@ -63,9 +63,11 @@ switch ($url[0]) {
|
||||
$viewport = explode('x', $viewport);
|
||||
$driver->manage()->window()->setSize(new \Facebook\WebDriver\WebDriverDimension($viewport[0], $viewport[1]));
|
||||
} else {
|
||||
$driver->manage()->window()->setSize(new \Facebook\WebDriver\WebDriverDimension(1024, 768));
|
||||
$viewport = [1024, 768];
|
||||
$driver->manage()->window()->setSize(new \Facebook\WebDriver\WebDriverDimension($viewport[0], $viewport[1]));
|
||||
}
|
||||
addToLog("$ip\tRequested $target with viewport " . implode('x', $viewport) . " and js " . ($js ? 'enabled' : 'disabled'));
|
||||
$viewportLabel = is_array($viewport) ? implode('x', $viewport) : (string) $viewport;
|
||||
addToLog("$ip\tRequested $target with viewport " . $viewportLabel . " and js " . ($js ? 'enabled' : 'disabled'));
|
||||
} catch (Exception $e) {
|
||||
header('HTTP/1.0 500 Internal Server Error');
|
||||
addToLog("$ip\tRequested $target but resulted in error:\t" . $e->getMessage());
|
||||
|
||||
Reference in New Issue
Block a user