Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(228)

Side by Side Diff: Source/core/frame/Location.cpp

Issue 874393006: Clear username and password from location.href when basic HTTP (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add LayoutTests. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2008, 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 return blankURL(); // Use "about:blank" while the page is still loading (before we have a frame). 61 return blankURL(); // Use "about:blank" while the page is still loading (before we have a frame).
62 62
63 return url; 63 return url;
64 } 64 }
65 65
66 String Location::href() const 66 String Location::href() const
67 { 67 {
68 if (!m_frame) 68 if (!m_frame)
69 return String(); 69 return String();
70 70
71 return url().string(); 71 return url().strippedForUseAsHref();
72 } 72 }
73 73
74 String Location::protocol() const 74 String Location::protocol() const
75 { 75 {
76 if (!m_frame) 76 if (!m_frame)
77 return String(); 77 return String();
78 return DOMURLUtilsReadOnly::protocol(url()); 78 return DOMURLUtilsReadOnly::protocol(url());
79 } 79 }
80 80
81 String Location::host() const 81 String Location::host() const
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 argv.append("LocalDOMWindow"); 269 argv.append("LocalDOMWindow");
270 argv.append("url"); 270 argv.append("url");
271 argv.append(enteredDocument->url()); 271 argv.append(enteredDocument->url());
272 argv.append(completedURL); 272 argv.append(completedURL);
273 activityLogger->logEvent("blinkSetAttribute", argv.size(), argv.data()); 273 activityLogger->logEvent("blinkSetAttribute", argv.size(), argv.data());
274 } 274 }
275 m_frame->navigate(*callingWindow->document(), completedURL, locationPolicy = = SetLocation::ReplaceThisFrame); 275 m_frame->navigate(*callingWindow->document(), completedURL, locationPolicy = = SetLocation::ReplaceThisFrame);
276 } 276 }
277 277
278 } // namespace blink 278 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/security/location-href-clears-username-password-expected.txt ('k') | Source/platform/weborigin/KURL.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698