Bug 97444 - ASSERT in KURL::KURL() when url did not inlude path.
Summary: ASSERT in KURL::KURL() when url did not inlude path.
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: All Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-24 03:27 PDT by yannick.poirier
Modified: 2012-09-24 09:25 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description yannick.poirier 2012-09-24 03:27:34 PDT
Construct a url :  KURL(ParsedURLString, "http://www.example.com" );

KURL hits ASSERT(url == m_string) because KURL appends a slash at the end of m_string

It's reproducible with CURL ResourceHandleManager.cpp:

headerCallback(char* ptr, size_t size, size_t nmemb, void* data){
...
curl_easy_getinfo(h, CURLINFO_EFFECTIVE_URL, &hdr);
/*  hdr might not contain a path */
d->m_response.setURL(KURL(ParsedURLString, hdr));

}
Comment 1 Alexey Proskuryakov 2012-09-24 09:25:48 PDT
The ParsedURLString constructor can only be used with strings returned by KURL::string() (and then only if the URL was valid).

It's a performance optimization applicable when we know that the string is normalized the way KURL likes it. For arbitrary URL strings, use a proper constructor with a correct base URL.