Coder Social home page Coder Social logo

FastCGI and routes about mojo HOT 4 CLOSED

mojolicious avatar mojolicious commented on July 20, 2024
FastCGI and routes

from mojo.

Comments (4)

kraih avatar kraih commented on July 20, 2024

I don't understand you, if there's really a bug please prepare a more detailed report with real test case, like https://github.com/kraih/mojo/blob/master/t/mojo/message.t#L1349.

from mojo.

seifer avatar seifer commented on July 20, 2024
  1. SCRIPT_NAME eq REQUEST_URI

$req = Mojo::Message::Request->new;
$req->parse(
SCRIPT_NAME => '/diag/upload',
SERVER_NAME => '127.0.0.1',
SERVER_ADMIN => '[no address given]',
PATH_INFO => '/diag/upload',
HTTP_CONNECTION => 'Keep-Alive',
REQUEST_METHOD => 'POST',
CONTENT_LENGTH => '135',
SCRIPT_FILENAME => '/tmp/SnLu1cQ3t2/test.fcgi',
SERVER_SOFTWARE => 'Apache/2.2.14 (Unix) mod_fastcgi/2.4.2',
QUERY_STRING => '',
REMOTE_PORT => '58232',
HTTP_USER_AGENT => 'Mojolicious (Perl)',
SERVER_PORT => '13028',
SERVER_SIGNATURE => '',
REMOTE_ADDR => '127.0.0.1',
CONTENT_TYPE => 'multipart/form-data; boundary=8jXGX',
SERVER_PROTOCOL => 'HTTP/1.1',
PATH => '/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin',
REQUEST_URI => '/diag/upload',
GATEWAY_INTERFACE => 'CGI/1.1',
SERVER_ADDR => '127.0.0.1',
DOCUMENT_ROOT => '/tmp/SnLu1cQ3t2',
PATH_TRANSLATED => '/tmp/test.fcgi/diag/upload',
HTTP_HOST => '127.0.0.1:13028'
);

print Dumper($req->url);

$req->url->path is empty, but this parameters need for correct routing.

  1. If SCRIPT_NAME is empty

$req = Mojo::Message::Request->new;
$req->parse(
SCRIPT_NAME => '',
SERVER_NAME => '127.0.0.1',
SERVER_ADMIN => '[no address given]',
PATH_INFO => '/diag/upload',
HTTP_CONNECTION => 'Keep-Alive',
REQUEST_METHOD => 'POST',
CONTENT_LENGTH => '135',
SCRIPT_FILENAME => '/tmp/SnLu1cQ3t2/test.fcgi',
SERVER_SOFTWARE => 'Apache/2.2.14 (Unix) mod_fastcgi/2.4.2',
QUERY_STRING => '',
REMOTE_PORT => '58232',
HTTP_USER_AGENT => 'Mojolicious (Perl)',
SERVER_PORT => '13028',
SERVER_SIGNATURE => '',
REMOTE_ADDR => '127.0.0.1',
CONTENT_TYPE => 'multipart/form-data; boundary=8jXGX',
SERVER_PROTOCOL => 'HTTP/1.1',
PATH => '/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin',
REQUEST_URI => '/diag/upload',
GATEWAY_INTERFACE => 'CGI/1.1',
SERVER_ADDR => '127.0.0.1',
DOCUMENT_ROOT => '/tmp/SnLu1cQ3t2',
PATH_TRANSLATED => '/tmp/test.fcgi/diag/upload',
HTTP_HOST => '127.0.0.1:13028'
);

print Dumper($req->url);

Routing work correct

from mojo.

kraih avatar kraih commented on July 20, 2024

Thanks, thats exactly what i needed.
But i'm afraid i have to tell you that everything works just as expected and spec compliant, so you might just be misunderstanding something.

from mojo.

seifer avatar seifer commented on July 20, 2024

Maybe. Its not critical.

from mojo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.