commit 6eec8166c66c21c84b9a410654db89c1ca558886
parent 2049bc72dc4506c915322254902f74f3ab112c49
Author: Joris Vink <joris@coders.se>
Date: Wed, 4 Feb 2015 12:04:07 +0100
"request" auth blocks should set their own response.
Diffstat:
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/auth.c b/src/auth.c
@@ -85,6 +85,10 @@ kore_auth(struct http_request *req, struct kore_auth *auth)
break;
}
+ /* Authentication types of "request" send their own HTTP responses. */
+ if (auth->type == KORE_AUTH_TYPE_REQUEST)
+ return (r);
+
kore_debug("kore_auth() for %s failed", req->path);
if (auth->redirect == NULL) {
diff --git a/src/config.c b/src/config.c
@@ -796,6 +796,8 @@ configure_authentication_type(char **argv)
current_auth->type = KORE_AUTH_TYPE_COOKIE;
} else if (!strcmp(argv[1], "header")) {
current_auth->type = KORE_AUTH_TYPE_HEADER;
+ } else if (!strcmp(argv[1], "request")) {
+ current_auth->type = KORE_AUTH_TYPE_REQUEST;
} else {
printf("unknown authentication type '%s'\n", argv[1]);
return (KORE_RESULT_ERROR);