close(i);
if((qp = strchr(url, '?')) != NULL)
*(qp++) = 0;
- /*
- * XXX: Currently missing:
- * SERVER_NAME (Partially)
- * SERVER_PORT
- */
putenv(sprintf2("SERVER_SOFTWARE=ashd/%s", VERSION));
putenv("GATEWAY_INTERFACE=CGI/1.1");
if(getenv("HTTP_VERSION"))
putenv(sprintf2("QUERY_STRING=%s", qp?qp:""));
if(getenv("REQ_HOST"))
putenv(sprintf2("SERVER_NAME=%s", getenv("REQ_HOST")));
+ if(getenv("REQ_X_ASH_SERVER_PORT"))
+ putenv(sprintf2("SERVER_PORT=%s", getenv("REQ_X_ASH_SERVER_PORT")));
+ if(getenv("REQ_X_ASH_PROTOCOL") && !strcmp(getenv("REQ_X_ASH_PROTOCOL"), "https"))
+ putenv("HTTPS=ON");
if(getenv("REQ_X_ASH_ADDRESS"))
putenv(sprintf2("REMOTE_ADDR=%s", getenv("REQ_X_ASH_ADDRESS")));
if(getenv("REQ_CONTENT_TYPE"))