Skip to content

Commit 736a11b

Browse files
committed
Fix line endings on tx'd HTTP headers
HTTP line endings must be terminated with CRLF, and the final line must be a blank line. The code previously ended lines with `\n`. This changes changes the line endings to `\r\n` and ensures the extra blank line at the end.
1 parent 09a0052 commit 736a11b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tls-client/HelloHttpsClient.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ int HelloHttpsClient::run()
132132

133133
/* Fill the request buffer */
134134
ret = snprintf(gp_buf, sizeof(gp_buf),
135-
"GET %s HTTP/1.1\nHost: %s\n\n", HTTP_REQUEST_FILE_PATH,
135+
"GET %s HTTP/1.1\r\nHost: %s\r\n\r\n", HTTP_REQUEST_FILE_PATH,
136136
server_name);
137137
req_len = static_cast<size_t>(ret);
138138
if (ret < 0 || req_len >= sizeof(gp_buf)) {

0 commit comments

Comments
 (0)