From 7ab0829823024dd07d15ff6786e3648388d4f28d Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 12 Apr 2016 13:38:18 -0700 Subject: Fix parsing of empty port sections in URLs The RFC does allow it. It even has examples showing them as valid. In section 6.2.3, it shows: http://example.com http://example.com/ http://example.com:/ http://example.com:80/ Change-Id: Id75834dab9ed466e94c7ffff1444b7195ad21cab Reviewed-by: Frederik Gladhorn Reviewed-by: Edward Welbourne Reviewed-by: Timur Pocheptsov --- src/corelib/io/qurl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/io/qurl.cpp') diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index b51119c7ad..b27321b2a6 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -1046,7 +1046,7 @@ inline void QUrlPrivate::setAuthority(const QString &auth, int from, int end, QU if (colonIndex == end - 1) { // found a colon but no digits after it - setError(PortEmptyError, auth, colonIndex + 1); + port = -1; } else if (uint(colonIndex) < uint(end)) { unsigned long x = 0; for (int i = colonIndex + 1; i < end; ++i) { -- cgit v1.2.3