evhtp next step

This commit is contained in:
Olof hagsand 2020-06-04 09:07:22 +02:00
parent e00dffadc5
commit bb3593bb99
2 changed files with 100 additions and 42 deletions

View file

@ -93,7 +93,7 @@ restconf_badrequest(FCGX_Request *r)
{
char *path;
path = FCGX_GetParam("DOCUMENT_URI", r->envp);
path = FCGX_GetParam("REQUEST_URI", r->envp);
FCGX_SetExitStatus(400, r->out);
FCGX_FPrintF(r->out, "Status: 400 Bad Request\r\n"); /* 400 bad request */
FCGX_FPrintF(r->out, "Content-Type: text/html\r\n\r\n");
@ -111,7 +111,7 @@ restconf_unauthorized(FCGX_Request *r)
{
char *path;
path = FCGX_GetParam("DOCUMENT_URI", r->envp);
path = FCGX_GetParam("REQUEST_URI", r->envp);
FCGX_SetExitStatus(401, r->out);
FCGX_FPrintF(r->out, "Status: 401 Unauthorized\r\n"); /* 401 unauthorized */
FCGX_FPrintF(r->out, "Content-Type: text/html\r\n\r\n");
@ -128,7 +128,7 @@ restconf_forbidden(FCGX_Request *r)
{
char *path;
path = FCGX_GetParam("DOCUMENT_URI", r->envp);
path = FCGX_GetParam("REQUEST_URI", r->envp);
FCGX_SetExitStatus(403, r->out);
FCGX_FPrintF(r->out, "Status: 403 Forbidden\r\n"); /* 403 forbidden */
FCGX_FPrintF(r->out, "Content-Type: text/html\r\n\r\n");
@ -145,7 +145,7 @@ restconf_notfound(FCGX_Request *r)
{
char *path;
path = FCGX_GetParam("DOCUMENT_URI", r->envp);
path = FCGX_GetParam("REQUEST_URI", r->envp);
FCGX_SetExitStatus(404, r->out);
FCGX_FPrintF(r->out, "Status: 404 Not Found\r\n"); /* 404 not found */
FCGX_FPrintF(r->out, "Content-Type: text/html\r\n\r\n");
@ -164,7 +164,7 @@ restconf_notacceptable(FCGX_Request *r)
{
char *path;
path = FCGX_GetParam("DOCUMENT_URI", r->envp);
path = FCGX_GetParam("REQUEST_URI", r->envp);
FCGX_SetExitStatus(406, r->out);
FCGX_FPrintF(r->out, "Status: 406 Not Acceptable\r\n"); /* 406 not acceptible */
@ -211,7 +211,7 @@ restconf_internal_server_error(FCGX_Request *r)
char *path;
clicon_debug(1, "%s", __FUNCTION__);
path = FCGX_GetParam("DOCUMENT_URI", r->envp);
path = FCGX_GetParam("REQUEST_URI", r->envp);
FCGX_FPrintF(r->out, "Status: 500 Internal Server Error\r\n"); /* 500 internal server error */
FCGX_FPrintF(r->out, "Content-Type: text/html\r\n\r\n");
FCGX_FPrintF(r->out, "<h1>Internal server error when accessing %s</h1>\n", path);