From aed4fdb08a6f6ea94f1495fde3e9487234fb152e Mon Sep 17 00:00:00 2001 From: Aadhavan Srinivasan Date: Fri, 19 May 2023 11:34:32 -0500 Subject: [PATCH] Fixed a bug where the program attempted to access a URL's struct members directly --- request.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/request.c b/request.c index b51f0c8..3a94001 100644 --- a/request.c +++ b/request.c @@ -1,4 +1,5 @@ #include +#include #include "url.h" #include "request.h" @@ -25,18 +26,18 @@ char* make_request(Request* req) { strcat(request_str,req->req_type); strcat(request_str," "); - strcat(request_str,req->url->filepath); + strcat(request_str,get_filepath(req->url)); strcat(request_str," HTTP/1.1"); strcat(request_str,"\r\n"); strcat(request_str,"Host: "); - strcat(request_str,req->url->hostname); + strcat(request_str,get_hostname(req->url)); strcat(request_str,"\r\n\r\n"); + return request_str; - - if (strcmp(req->url->schema,"http") == 0) { - - } else if (strcmp(req->url->schema,"https") == 0) { + if (strcmp(get_schema(req->url),"http") == 0) { + + } else if (strcmp(get_schema(req->url),"https") == 0) { } }