Add basic auth. Fixes #4

This commit is contained in:
2019-11-17 10:00:17 -05:00
parent 16ccc6c0d3
commit 204034d859
9 changed files with 84 additions and 2 deletions

View File

@@ -157,6 +157,12 @@ int web_args_validate(web_args_t *args, int argc, const char **argv) {
args->port = DEFAULT_PORT;
}
if (args->credentials != NULL) {
args->b64credentials = onion_base64_encode(args->credentials, (int)strlen(args->credentials));
//Remove trailing newline
*(args->b64credentials + strlen(args->b64credentials) - 1) = '\0';
}
args->index_count = argc - 1;
args->indices = argv + 1;