summaryrefslogtreecommitdiff
path: root/beos/beos_filetype.cpp
diff options
context:
space:
mode:
authorFran├žois Revel <mmu_man@netsurf-browser.org>2011-03-21 21:15:58 +0000
committerFran├žois Revel <mmu_man@netsurf-browser.org>2011-03-21 21:15:58 +0000
commitd2174fa8cc06c1e94d07bcab98efd00046a9ce8c (patch)
treea8f56de41ba41b3dcf2f5cf5b3c7e17a53cc83eb /beos/beos_filetype.cpp
parent0d534e8c4716a04f1b433a5bbec60a4224af7006 (diff)
downloadnetsurf-d2174fa8cc06c1e94d07bcab98efd00046a9ce8c.tar.gz
netsurf-d2174fa8cc06c1e94d07bcab98efd00046a9ce8c.tar.bz2
Change rsrc: fetcher to check the mime type of resources from the extension. Add needed resource to get about: working.
svn path=/trunk/netsurf/; revision=12119
Diffstat (limited to 'beos/beos_filetype.cpp')
-rw-r--r--beos/beos_filetype.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/beos/beos_filetype.cpp b/beos/beos_filetype.cpp
index 75fe870c8..d8920902d 100644
--- a/beos/beos_filetype.cpp
+++ b/beos/beos_filetype.cpp
@@ -96,6 +96,18 @@ const char *fetch_filetype(const char *unix_path)
// NOT THREADSAFE
static char type[B_MIME_TYPE_LENGTH];
+ // override reading the mime type for known types
+ // avoids getting CSS files as text/x-source-code
+ // even though it's the mime sniffer rules that should be fixed.
+ BString ext(unix_path);
+ ext.Remove(0, ext.FindLast('.') + 1);
+ for (i = 0; default_types[i].type; i++) {
+ if (ext == default_types[i].ext1)
+ return default_types[i].type;
+ if (ext == default_types[i].ext2)
+ return default_types[i].type;
+ }
+
BEntry entry(unix_path, true);
BNode node(&entry);
err = node.InitCheck();
@@ -110,18 +122,6 @@ const char *fetch_filetype(const char *unix_path)
if (err < B_OK)
return "test/plain";
- // override reading the mime type for known types
- // avoids getting CSS files as text/x-source-code
- // even though it's the mime sniffer rules that should be fixed.
- BString ext(unix_path);
- ext.Remove(0, ext.FindLast('.') + 1);
- for (i = 0; default_types[i].type; i++) {
- if (ext == default_types[i].ext1)
- return default_types[i].type;
- if (ext == default_types[i].ext2)
- return default_types[i].type;
- }
-
err = info.GetType(type);
if (err < B_OK) {
// not there yet, sniff and retry