deislabs / wagi

Write HTTP handlers in WebAssembly with a minimal amount of work

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PATH_TRANSLATED should be different

technosophos opened this issue · comments

According to the CGI spec, the PATH_TRANSLATED env var was a path to a file on the filesystem. We could use PATH_TRANSLATED to hold the path info with the prefix chopped off. E.g. if the route matches is /foo/... and the PATH_INFO is /foo/bar/baz, then the PATH_TRANSLATED would be /bar/baz.

Since this is a frequently needed transformation, it is probably a good idea to do it.

If we are worried about overloading a CGI term, we could use something like X_SUBPATH or something

Instead of re-purposing PATH_TRANSLATED, I am going to introduce X_RELATIVE_PATH. And its value will be bar/baz, not /bar/baz.