nnmm icon indicating copy to clipboard operation
nnmm copied to clipboard

php script not returning a URL

Open ScrumpyJack opened this issue 6 years ago • 0 comments

Using curl, the php script does not return a URL.

Each paste gets added to the database, with an $id, but the location of the pastes isn't returned (https://example.com/?$id)

nginx config:

    location / {
    index        index.php;
        }
    location ~ \.php$ {
        fastcgi_pass unix:/run/php5-fpm.sock;
        fastcgi_index index.php;
        include fastcgi.conf;
    }


what could be going wrong?

edit: same result when trying echo "test" | curl --data-urlencode @- "https://nnmm.nl"

If I add a header to echo $out, i see the header in the response, so it must be something wrong with the print($out); statement

    header("Content-Length: ".strlen($out));
    header("Content-Special: $out");
    print($out);

< Content-Type: text/plain; charset=UTF-8; imeanit=yes < Content-Length: 20 < Connection: keep-alive < X-Powered-By: PHP/5.6.32 < X-Content-Type-Options: nosniff < Content-Disposition: inline < Access-Control-Allow-Origin: * < Access-Control-Allow-Methods: GET, POST < Access-Control-Allow-Headers: Content-Type < Access-Control-Expose-Headers: Content-Type < Access-Control-Max-Age: 600 < Content-Special: https://example/?eSn

ScrumpyJack avatar May 18 '18 13:05 ScrumpyJack