feat: PoC uploading of pastes

This commit is contained in:
Jef Roosens 2023-05-30 10:17:46 +02:00
parent dfbd179c7a
commit 87312f2d84
Signed by: Jef Roosens
GPG key ID: B75D4F293C7052DB
6 changed files with 122 additions and 27 deletions

View file

@ -48,6 +48,7 @@ typedef struct http_request {
} body;
size_t body_len;
size_t body_received;
char *body_file_name;
regmatch_t regex_groups[HTTP_MAX_REGEX_GROUPS];
struct phr_header headers[HTTP_MAX_ALLOWED_HEADERS];
size_t num_headers;

View file

@ -111,11 +111,15 @@ void http_loop_res_add_header(http_loop_ctx *ctx, http_header type,
*/
bool http_loop_step_body_to_buf(event_loop_conn *conn);
bool http_loop_step_body_to_file(event_loop_conn *conn);
/*
* Authenticate the request using the X-Api-Key header
*/
bool http_loop_step_auth(event_loop_conn *conn);
bool http_loop_step_switch_res(event_loop_conn *conn);
/**
* Initialize a new http loop
*/

View file

@ -3,7 +3,7 @@
#include "http_loop.h"
extern http_route lander_routes[3];
extern http_route lander_routes[4];
bool lander_get_index(event_loop_conn *conn);
@ -11,4 +11,6 @@ bool lander_get_entry(event_loop_conn *conn);
bool lander_post_redirect(event_loop_conn *conn);
bool lander_post_paste(event_loop_conn *conn);
#endif