[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

cblu cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:47:42 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit d21f8e03008d79b0581c1c1387f579dbf8f8a216
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Oct 8 15:08:20 2002 +0000

    	Partial fix for 2967073 - should open all TEXT type files, at least
    
            * WebView.subproj/WebControllerPrivate.m:
            (+[WebController _MIMETypeForFile:]): Sniff for HTML in the fail case.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2272 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 835e928..c8edef9 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,10 @@
+2002-10-08  Chris Blumenberg  <cblu at apple.com>
+
+	Partial fix for 2967073 - should open all TEXT type files, at least
+
+        * WebView.subproj/WebControllerPrivate.m:
+        (+[WebController _MIMETypeForFile:]): Sniff for HTML in the fail case.
+
 2002-10-07  Darin Adler  <darin at apple.com>
 
 	WebKit part of implementation of multipart forms posting.
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 835e928..c8edef9 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,10 @@
+2002-10-08  Chris Blumenberg  <cblu at apple.com>
+
+	Partial fix for 2967073 - should open all TEXT type files, at least
+
+        * WebView.subproj/WebControllerPrivate.m:
+        (+[WebController _MIMETypeForFile:]): Sniff for HTML in the fail case.
+
 2002-10-07  Darin Adler  <darin at apple.com>
 
 	WebKit part of implementation of multipart forms posting.
diff --git a/WebKit/WebView.subproj/WebControllerPrivate.m b/WebKit/WebView.subproj/WebControllerPrivate.m
index d1a88ff..08effeb 100644
--- a/WebKit/WebView.subproj/WebControllerPrivate.m
+++ b/WebKit/WebView.subproj/WebControllerPrivate.m
@@ -21,6 +21,7 @@
 #import <WebFoundation/WebCacheLoaderConstants.h>
 #import <WebFoundation/WebError.h>
 #import <WebFoundation/WebFileTypeMappings.h>
+#import <WebFoundation/WebNSStringExtras.h>
 #import <WebFoundation/WebResourceHandle.h>
 #import <WebFoundation/WebResourceHandlePrivate.h>
 #import <WebFoundation/WebResourceRequest.h>
@@ -197,8 +198,15 @@
     }
     else {
         result = [[WebFileTypeMappings sharedMappings] MIMETypeForExtension:extension];
-        if (result == nil) {
-            result = @"application/octet-stream";
+        if (!result || [result isEqualToString:@"application/octet-stream"]) {
+            NSString *contents = [[NSString alloc] initWithData:[NSData dataWithContentsOfFile:path]
+                                                       encoding:NSASCIIStringEncoding];
+            if([contents _web_looksLikeHTMLDocument]){
+                result = @"text/html";
+            }else{
+                result = @"application/octet-stream";
+            }
+            [contents release];
         }
     }
     
diff --git a/WebKit/WebView.subproj/WebViewPrivate.m b/WebKit/WebView.subproj/WebViewPrivate.m
index d1a88ff..08effeb 100644
--- a/WebKit/WebView.subproj/WebViewPrivate.m
+++ b/WebKit/WebView.subproj/WebViewPrivate.m
@@ -21,6 +21,7 @@
 #import <WebFoundation/WebCacheLoaderConstants.h>
 #import <WebFoundation/WebError.h>
 #import <WebFoundation/WebFileTypeMappings.h>
+#import <WebFoundation/WebNSStringExtras.h>
 #import <WebFoundation/WebResourceHandle.h>
 #import <WebFoundation/WebResourceHandlePrivate.h>
 #import <WebFoundation/WebResourceRequest.h>
@@ -197,8 +198,15 @@
     }
     else {
         result = [[WebFileTypeMappings sharedMappings] MIMETypeForExtension:extension];
-        if (result == nil) {
-            result = @"application/octet-stream";
+        if (!result || [result isEqualToString:@"application/octet-stream"]) {
+            NSString *contents = [[NSString alloc] initWithData:[NSData dataWithContentsOfFile:path]
+                                                       encoding:NSASCIIStringEncoding];
+            if([contents _web_looksLikeHTMLDocument]){
+                result = @"text/html";
+            }else{
+                result = @"application/octet-stream";
+            }
+            [contents release];
         }
     }
     

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list