Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions Utilities/Adaptors/Adaptor/request.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*

Copyright � 2000-2007 Apple, Inc. All Rights Reserved.
Copyright � 2000-2007 Apple, Inc. All Rights Reserved.

The contents of this file constitute Original Code as defined in and are
subject to the Apple Public Source License Version 1.1 (the 'License').
Expand Down Expand Up @@ -134,11 +134,19 @@ void req_reformatRequest(HTTPRequest *req, WOAppReq *app, WOURLComponents *wc, c
strcat(req->request_str,http_version);
if (strcasecmp(http_version,"HTTP/1.1") == 0)
{
req_addHeader(req, "Host", app->host, 0);
/* Only add Host header if it doesn't already exist (avoid duplicate headers) */
if (!req_HeaderForKey(req, "Host"))
{
req_addHeader(req, "Host", app->host, 0);
}
}
} else {
strcat(req->request_str,default_http_version);
req_addHeader(req, "Host", app->host, 0);
/* Only add Host header if it doesn't already exist (avoid duplicate headers) */
if (!req_HeaderForKey(req, "Host"))
{
req_addHeader(req, "Host", app->host, 0);
}
}
strcat(req->request_str,"\r\n");

Expand Down