Skip to content

Conversation

johnmckerrell
Copy link
Contributor

I thought I'd come across a bug in the HttpClient library, then I wasn't so sure, but now I think I can probably class it as a bug after all.

Specifically, when sending the host header it doesn't send the port number. Now in my code, as I'm using:

int HttpClient::startRequest(const IPAddress& aServerAddress, const char* aServerName, uint16_t aServerPort, const char* aURLPath, const char* aHttpMethod, const char* aUserAgent)

You could say that I should pass the port number in aServerName, but then if you're using:

int HttpClient::startRequest(const char* aServerName, uint16_t aServerPort, const char* aURLPath, const char* aHttpMethod, const char* aUserAgent)

If you pass a port number in there other than 80 it still doesn't get sent. Also with the variable being called aServerName rather than "Host" I do think it's correct (and, of course, easier :) that HttpClient would send the port.

amcewen added a commit that referenced this pull request Sep 28, 2012
Fixing bug in HttpClient Host Header when the port isn't the default
@amcewen amcewen merged commit fc72d82 into amcewen:master Sep 28, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants