apioo/psx-sample

127.0.0.1 vs localhost

Closed this issue · 1 comments

Hey there!

I hope this is the appropriate place to post this issue (or should I post further issues in apioo/psx?)

I just spend a painful amount of time on the documentation page and wondered why my endpoints didn't work anymore (the endpoints are displayed on the left, but their content is not displayed) so the front end could make api requests to /tool/doc but not /tool/doc/:version/*path (DocumentationController::doDetail) and i was wondering why it doesn't work until I noticed that in the configuration file i had my psx_url set up to

http://127.0.0.1/psx/public

while i was trying to access

http://localhost/psx/public

I'm wondering if this is a bug since accessing tool/docs works on 127.0.0.1 AND localhost while /tool/doc/:version/_path only works if it matches the exact configured url (127.0.0.1 _OR* localhost)

Hi, in general psx parses the configured url and removes the provided path from
the request so that it is possible to use psx also inside a folder i.e.: If we have
the following url in the configuration
http://127.0.0.1/psx/public

and we request the endpoint
http://127.0.0.1/psx/public/index.php/tool/doc

PSX internally works with the url as
http://127.0.0.1/tool/doc

In case you provide a wrong url in the configuration psx may removes too much
parts from the path. Unfortunately this explains not your problem since
127.0.0.1 and localhost have the same char length.

I could not quickly reproduce the error with the sample project. I can access
both endpoints with localhost and 127.0.0.1. Do you have additional informations
howto reproduce this error.

I hope this is the appropriate place to post this issue (or should I post further issues in apioo/psx?)

no problem, yes for issues regarding the framework apioo/psx is the better place