Bug 37777

Summary: protocolHostAndPortEquals host check makes a wrong assumption
Product: WebKit Reporter: Julien Chaffraix <jchaffraix>
Component: WebCore Misc.Assignee: Julien Chaffraix <jchaffraix>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Proposed fix: take URLs credential into account ap: review+, jchaffraix: commit-queue-

Julien Chaffraix
Reported 2010-04-18 15:01:09 PDT
The logic assumes that both the URL starts at the same position. This is right for most URL but is wrong for URL containing credentials: the code will return false for http://foo.example.com and http://user:pass@foo.example.com.
Attachments
Proposed fix: take URLs credential into account (5.29 KB, patch)
2010-04-18 15:37 PDT, Julien Chaffraix
ap: review+
jchaffraix: commit-queue-
Julien Chaffraix
Comment 1 2010-04-18 15:37:52 PDT
Created attachment 53639 [details] Proposed fix: take URLs credential into account
Alexey Proskuryakov
Comment 2 2010-04-19 23:13:33 PDT
Comment on attachment 53639 [details] Proposed fix: take URLs credential into account + int lengthHostA = a.hostEnd() - hostStartA; It's strange that the order of words is different in old and new variables, "host start" vs. "length host". r=me, good catch!
Julien Chaffraix
Comment 3 2010-04-24 09:47:18 PDT
(In reply to comment #2) > (From update of attachment 53639 [details]) > + int lengthHostA = a.hostEnd() - hostStartA; > > It's strange that the order of words is different in old and new variables, > "host start" vs. "length host". Landed in r58219 with this correction.
Note You need to log in before you can comment on or make changes to this bug.