Changeset 189200 in webkit
- Timestamp:
- Aug 31, 2015 5:29:24 PM (9 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r189198 r189200 1 2015-08-31 Brent Fulgham <bfulgham@apple.com> 2 3 [Win] WebKit cannot load pages based on "file://" URLs 4 https://bugs.webkit.org/show_bug.cgi?id=148596 5 <rdar://problem/22432585> 6 7 Reviewed by Dean Jackson. 8 9 * platform/URL.cpp: 10 (WebCore::URL::URL): Work around bug that causes this assertion to fire on 11 the Apple Windows build. 12 * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp: 13 (WebCore::adjustMIMETypeIfNecessary): Added. If the URL is for a local file, 14 determine the MIME type based on extension. Otherwise use the default MIME type. 15 (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse): If 16 the CFURLResponse has no MIME type, call 'adjustMIMETypeIfNecessary'. 17 1 18 2015-08-31 Chris Dumez <cdumez@apple.com> 2 19 -
trunk/Source/WebCore/platform/URL.cpp
r183901 r189200 433 433 { 434 434 parse(url); 435 #if OS(WINDOWS) 436 // FIXME(148598): Work around Windows local file handling bug in CFNetwork 437 ASSERT(isLocalFile() || url == m_string); 438 #else 435 439 ASSERT(url == m_string); 440 #endif 436 441 } 437 442 -
trunk/Source/WebCore/platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp
r185971 r189200 1 1 /* 2 * Copyright (C) 2004-2013 Apple Inc. All rights reserved.2 * Copyright (C) 2004-2013, 2015 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 110 110 CFURLResponseSetMIMEType(response, defaultMIMETypeString); 111 111 } 112 113 static void adjustMIMETypeIfNecessary(CFURLResponseRef cfResponse) 114 { 115 RetainPtr<CFStringRef> result = CFURLResponseGetMIMEType(cfResponse); 116 RetainPtr<CFStringRef> originalResult = result; 117 118 if (!result) { 119 CFURLRef cfURL = CFURLResponseGetURL(cfResponse); 120 URL url(cfURL); 121 if (url.isLocalFile()) { 122 String mimeType = mimeTypeFromURL(url); 123 result = mimeType.createCFString().leakRef(); 124 } 125 } 126 127 if (!result) { 128 static CFStringRef defaultMIMETypeString = WebCore::defaultMIMEType().createCFString().leakRef(); 129 result = defaultMIMETypeString; 130 } 131 132 if (result != originalResult) 133 CFURLResponseSetMIMEType(cfResponse, result.get()); 134 } 112 135 #endif // !PLATFORM(COCOA) 113 136 … … 132 155 #endif // !PLATFORM(IOS) 133 156 #else 157 if (!CFURLResponseGetMIMEType(cfResponse)) 158 adjustMIMETypeIfNecessary(cfResponse); 159 134 160 if (!CFURLResponseGetMIMEType(cfResponse)) { 135 161 // We should never be applying the default MIMEType if we told the networking layer to do content sniffing for handle.
Note: See TracChangeset
for help on using the changeset viewer.