diff --git a/Dockerfile b/Dockerfile index 5b1f4e0..3b716ec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,3 @@ FROM php:8.0-apache RUN apt-get update && apt-get install libpq-dev -y RUN docker-php-ext-install pgsql RUN pecl install redis && docker-php-ext-enable redis - -RUN echo 'Listen 8080' > /etc/apache2/ports.conf - -EXPOSE 8080 diff --git a/js/base.php b/js/base.php index 78d7faa..a6d95cf 100644 --- a/js/base.php +++ b/js/base.php @@ -363,6 +363,16 @@ const http = { payload = payload || null; callbk = callbk || null; + // Apache servers work like shit on redirects + // this code is needed to avoid 301 on API, + /// which makes POST and other request fail. + path = path.trim(); + if (path.indexOf('?') !== -1) + path = path.replace(/(?<=[^\/])\?/, '/?'); + else if (!path.endsWith('/') && + !(path.endsWith('.php') || path.endsWith('.html'))) + path += '/'; + //console.log(path); printstack(); const httpid = uuidv4(); const httpdiv = document.getElementById('http');