200 return content type

This commit is contained in:
Pin
2022-03-06 23:47:02 -05:00
parent fac85bb352
commit 52f01b6c69

View File

@@ -22,7 +22,7 @@ int return200Request(int socket, unsigned char *content, SSL *ssl) {
char *message = ""; char *message = "";
if (content != NULL) { if (content != NULL) {
message = calloc(strlen((char *)content) + 128, sizeof(char)); message = calloc(strlen((char *)content) + 128, sizeof(char));
sprintf(message, "HTTP/1.1 200 OK\nContent-Length: %zu\nConnection: close\n\n%s", sprintf(message, "HTTP/1.1 200 OK\nContent-Length: %zu\nContent-Type: text/html\nConnection: close\n\n%s",
strlen((char *)content), content); strlen((char *)content), content);
} else { // Sending empty response } else { // Sending empty response
message = calloc(128, sizeof(char)); message = calloc(128, sizeof(char));