diff options
author | Aleksey Veresov <aleksey@veresov.pro> | 2019-09-17 17:20:30 +0300 |
---|---|---|
committer | Aleksey Veresov <aleksey@veresov.pro> | 2019-09-17 17:20:30 +0300 |
commit | a14bbfa1ff411a4dc1b2b1935fbab4cc7f0c18f1 (patch) | |
tree | 2ae2eca3beb4ad7ca6a9d1d310ef3a333343d8c0 | |
parent | 1427a57ac2c766f0321e5ccd5a6890ffe7323d17 (diff) | |
download | magi-a14bbfa1ff411a4dc1b2b1935fbab4cc7f0c18f1.tar magi-a14bbfa1ff411a4dc1b2b1935fbab4cc7f0c18f1.tar.xz magi-a14bbfa1ff411a4dc1b2b1935fbab4cc7f0c18f1.zip |
Request environmental variables were improved.
-rw-r--r-- | src/request.c | 1 | ||||
-rw-r--r-- | src/request.h | 21 |
2 files changed, 21 insertions, 1 deletions
diff --git a/src/request.c b/src/request.c index 79388f3..8da8975 100644 --- a/src/request.c +++ b/src/request.c @@ -154,6 +154,7 @@ static int cgi_env(struct magi_request *r) ok = ok && plain_env(&r->server_port, "SERVER_PORT"); ok = ok && lower_env(&r->server_protocol, "SERVER_PROTOCOL"); ok = ok && plain_env(&r->server_software, "SERVER_SOFTWARE"); + ok = ok && plain_env(&r->path_info, "PATH_INFO"); return ok; } diff --git a/src/request.h b/src/request.h index 4957099..56513da 100644 --- a/src/request.h +++ b/src/request.h @@ -6,6 +6,24 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Request + * + * Example for enivronmental variables: + * Request: http://example.com/cgi-bin/script/foo/bar?var2=url%20enc + * method: get + * uri: /cgi-bin/script/foo/bar?var2=url%20enc + * document_root: { absolute path to root directory of domain } + * document_uri: /cgi-bin/script/foo/bar + * script_name: /cgi-bin/script + * script_filename: { absolute path to script on server machine } + * remote_addr: { client IP } + * remote_port: { client port } + * server_addr: { server IP } + * server_name: example.com + * (^ Better to use http_params["HTTP_HOST"] -- server_name can be IP too.) + * server_port: 80 + * server_protocol: http/1.1 + * server_software: { name of web server software } + * path_info: /foo/bar */ struct magi_request { struct magi_field_list *fields; @@ -23,8 +41,9 @@ struct magi_request { char *server_port; char *server_protocol; char *server_software; + char *path_info; struct magi_param_list *http_params; -}; /* http[s]://{server_name}[:{server_port}]{script_name}[?...] */ +}; /* Common Request Handling */ |