diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2023-03-08 18:48:58 +0100 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2023-03-08 18:48:58 +0100 |
| commit | 7176bd3c94950e9aa0731cc4f9bb266974dd59da (patch) | |
| tree | 3e4b1a9166f5da198b6e7e82e73e8f599cd67f4b | |
| parent | e37a0248e865db2d69c89d5c7bd8651dae255cab (diff) | |
| download | slcl-7176bd3c94950e9aa0731cc4f9bb266974dd59da.tar.gz | |
Call page_forbidden on invalid auth
| -rw-r--r-- | main.c | 19 |
1 files changed, 1 insertions, 18 deletions
@@ -483,24 +483,7 @@ static int getnode(const struct http_payload *const p, if (auth_cookie(a, &p->cookie)) { fprintf(stderr, "%s: auth_cookie failed\n", __func__); - - *r = (const struct http_response) - { - .status = HTTP_STATUS_SEE_OTHER - }; - - if (http_response_add_header(r, "Location", "/")) - { - fprintf(stderr, "%s: http_response_add_header failed\n", __func__); - return -1; - } - else if (http_response_add_header(r, "Content-Type", "text/html")) - { - fprintf(stderr, "%s: http_response_add_header failed\n", __func__); - return -1; - } - - return 0; + return page_forbidden(r); } const char *const username = p->cookie.field, |
