The HTTP/1.1 Host request header must include port if it's not the default (80).

Change-Id: Idcc1429fbeecef99dad435208c9a1bd481132e2b
This commit is contained in:
Andreas Huber
2010-12-16 10:45:24 -08:00
parent 6a4d0a6af2
commit 3abb7dde86
2 changed files with 12 additions and 0 deletions

View File

@@ -158,6 +158,9 @@ status_t NuHTTPDataSource::connect(
request.append(" HTTP/1.1\r\n");
request.append("Host: ");
request.append(mHost);
if (mPort != 80) {
request.append(StringPrintf(":%u", mPort).c_str());
}
request.append("\r\n");
if (offset != 0) {

View File

@@ -14,6 +14,10 @@
* limitations under the License.
*/
//#define LOG_NDEBUG 0
#define LOG_TAG "M3UParser"
#include <utils/Log.h>
#include "include/M3UParser.h"
#include <media/stagefright/foundation/AMessage.h>
@@ -88,6 +92,9 @@ static bool MakeURL(const char *baseURL, const char *url, AString *out) {
if (!strncasecmp("http://", url, 7)) {
// "url" is already an absolute URL, ignore base URL.
out->setTo(url);
LOGV("base:'%s', url:'%s' => '%s'", baseURL, url, out->c_str());
return true;
}
@@ -108,6 +115,8 @@ static bool MakeURL(const char *baseURL, const char *url, AString *out) {
out->append(url);
}
LOGV("base:'%s', url:'%s' => '%s'", baseURL, url, out->c_str());
return true;
}