Move the auth handler out of JS. #7

This commit is contained in:
2024-03-31 16:15:50 -04:00
parent 9ce30dee70
commit b04eccdbda
11 changed files with 872 additions and 242 deletions

View File

@ -701,6 +701,14 @@ static void _test_http_async(uv_async_t* async)
static void _test_http_thread(void* data)
{
test_http_t* test = data;
const char* value = tf_http_get_cookie("a=foo; b=bar", "a");
assert(strcmp(value, "foo") == 0);
tf_free((void*)value);
value = tf_http_get_cookie("a=foo; b=bar", "b");
assert(strcmp(value, "bar") == 0);
tf_free((void*)value);
assert(tf_http_get_cookie("a=foo; b=bar", "c") == NULL);
int r = system("curl -v http://localhost:23456/404");
assert(WEXITSTATUS(r) == 0);
tf_printf("curl returned %d\n", WEXITSTATUS(r));