Changeset 220805 in webkit
- Timestamp:
- Aug 16, 2017 1:20:56 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r220804 r220805 1 2017-08-16 Eric Carlson <eric.carlson@apple.com> 2 3 Consider allow gUM to be called from localhost without https 4 https://bugs.webkit.org/show_bug.cgi?id=173457 5 <rdar://problem/33900527> 6 7 Reviewed by Youenn Fablet. 8 9 * http/tests/media/media-stream/get-user-media-localhost-expected.txt: Added. 10 * http/tests/media/media-stream/get-user-media-localhost.html: Added. 11 * http/tests/media/media-stream/get-user-media-loopback-ip-expected.txt: Added. 12 * http/tests/media/media-stream/get-user-media-loopback-ip.html: Added. 13 1 14 2017-08-16 Ryan Haddad <ryanhaddad@apple.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r220799 r220805 1 2017-08-16 Eric Carlson <eric.carlson@apple.com> 2 3 Consider allow gUM to be called from localhost without https 4 https://bugs.webkit.org/show_bug.cgi?id=173457 5 <rdar://problem/33900527> 6 7 Reviewed by Youenn Fablet. 8 9 Tests: http/tests/media/media-stream/get-user-media-localhost.html 10 http/tests/media/media-stream/get-user-media-loopback-ip.html 11 12 * Modules/mediastream/UserMediaRequest.cpp: 13 (WebCore::isSecure): Call SchemeRegistry::shouldTreatURLSchemeAsSecure instead of looking for 14 the string 'https'. 15 (WebCore::canCallGetUserMedia): Allow localhost or loopback address. 16 17 * page/SecurityOrigin.cpp: 18 (WebCore::isLoopbackIPAddress): Add a comment. 19 (WebCore::shouldTreatAsPotentionallyTrustworthy): Move tests for localhost and loopback address 20 to isLocalHostOrLoopbackIPAddress, call it. 21 (WebCore::SecurityOrigin::isLocalHostOrLoopbackIPAddress): 22 * page/SecurityOrigin.h: 23 1 24 2017-08-16 Chris Dumez <cdumez@apple.com> 2 25 -
trunk/Source/WebCore/Modules/mediastream/UserMediaRequest.cpp
r219856 r220805 2 2 * Copyright (C) 2011 Ericsson AB. All rights reserved. 3 3 * Copyright (C) 2012 Google Inc. All rights reserved. 4 * Copyright (C) 2013-201 6Apple Inc. All rights reserved.4 * Copyright (C) 2013-2017 Apple Inc. All rights reserved. 5 5 * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies). 6 6 * … … 45 45 #include "MediaConstraints.h" 46 46 #include "RealtimeMediaSourceCenter.h" 47 #include "SchemeRegistry.h" 47 48 #include "Settings.h" 48 49 #include "UserMediaController.h" … … 95 96 { 96 97 auto& response = documentLoader.response(); 97 return response.url().protocolIs("https")98 return SchemeRegistry::shouldTreatURLSchemeAsSecure(response.url().protocol().toStringWithoutCopying()) 98 99 && response.certificateInfo() 99 100 && !response.certificateInfo()->containsNonRootSHA1SignedCertificate(); … … 103 104 { 104 105 bool requiresSecureConnection = document.settings().mediaCaptureRequiresSecureConnection(); 105 if (requiresSecureConnection && !isSecure(*document.loader())) { 106 auto& documentLoader = *document.loader(); 107 if (requiresSecureConnection && !isSecure(documentLoader) && !SecurityOrigin::isLocalHostOrLoopbackIPAddress(documentLoader.response().url())) { 106 108 errorMessage = "Trying to call getUserMedia from an insecure document."; 107 109 return false; -
trunk/Source/WebCore/page/SecurityOrigin.cpp
r218028 r220805 102 102 static bool isLoopbackIPAddress(const URL& url) 103 103 { 104 // The IPv6 loopback address is 0:0:0:0:0:0:0:1, which compresses to ::1. 104 105 ASSERT(url.isValid()); 105 106 auto host = url.host(); … … 131 132 return true; 132 133 133 if (isLoopbackIPAddress(url)) 134 return true; 135 136 // FIXME: Ensure that localhost resolves to the loopback address. 137 if (equalLettersIgnoringASCIICase(url.host(), "localhost")) 134 if (SecurityOrigin::isLocalHostOrLoopbackIPAddress(url)) 138 135 return true; 139 136 … … 588 585 } 589 586 587 bool SecurityOrigin::isLocalHostOrLoopbackIPAddress(const URL& url) 588 { 589 if (isLoopbackIPAddress(url)) 590 return true; 591 592 // FIXME: Ensure that localhost resolves to the loopback address. 593 if (equalLettersIgnoringASCIICase(url.host(), "localhost")) 594 return true; 595 596 return false; 597 } 598 590 599 } // namespace WebCore -
trunk/Source/WebCore/page/SecurityOrigin.h
r220497 r220805 203 203 bool isPotentionallyTrustworthy() const { return m_isPotentionallyTrustworthy; } 204 204 205 static bool isLocalHostOrLoopbackIPAddress(const URL&); 206 205 207 private: 206 208 SecurityOrigin();
Note: See TracChangeset
for help on using the changeset viewer.