Bug 5954 - Cleanup Content-Type parsing
Summary: Cleanup Content-Type parsing
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P4 Enhancement
Assignee: Nobody
URL:
Keywords:
Depends on: 8644
Blocks: 14059
  Show dependency treegraph
 
Reported: 2005-12-05 13:06 PST by Alexey Proskuryakov
Modified: 2007-07-13 04:49 PDT (History)
2 users (show)

See Also:


Attachments
Move getMIMEType and getCharset to HTTPParsers, and one parse method from platform/net/cf (9.99 KB, patch)
2007-07-10 16:19 PDT, Holger Freyther
no flags Details | Formatted Diff | Diff
Move getMIMEType and getCharset to HTTPParsers, and one parse method from platform/net/cf (10.28 KB, patch)
2007-07-10 17:23 PDT, Holger Freyther
no flags Details | Formatted Diff | Diff
Move getMIMEType and getCharset to HTTPParsers, and one parse method from platform/net/cf (10.23 KB, patch)
2007-07-11 11:56 PDT, Holger Freyther
ap: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Proskuryakov 2005-12-05 13:06:10 PST
(from bug 5744).

Currently, at least three distinct parsers for Content-Type strings are used:
1) For HTTP headers, Foundation does the parsing;
2) Http-Equiv metas are parsed in khtml::Decoder;
3) XmlHttpRequest MIME type overrides are parsed in xmlhttprequest.cpp.

The implementations are not identical in implementation and behavior, so they need to be synchronized 
and, if possible, reused.
Comment 1 Eric Seidel (no email) 2005-12-27 13:29:38 PST
Assigning bugs which hyatt is not actively working on to "nobody" for clarity/consistancy.
Comment 2 Alexey Proskuryakov 2006-12-08 10:27:48 PST
We now have plaftorm/network/HTTPParsers.{h,cpp} to hold this common implementation.
Comment 3 Holger Freyther 2007-07-10 16:19:59 PDT
Created attachment 15468 [details]
Move getMIMEType and getCharset to HTTPParsers, and one parse method from platform/net/cf

Note: This copies two methods from a LGPL file to a BSD one.

These three parse methods will be used by the CURL backend to implement ResourceResponse handling. This is existing code copied to a different place. All three methods have known and documented issues and are not taken care by this change. The most important part of this change is making these three methods available to the CURL backend.

Fixing and improving the implementation will be done in following patches.
Comment 4 Holger Freyther 2007-07-10 16:21:10 PDT
The CURL backend patch needs these three methods for the implementation of ResourceResponse.
Comment 5 Holger Freyther 2007-07-10 16:28:05 PDT
I forgot to update the copyright header. Apple Inc. is missing from HTTPParsers.cpp
Comment 6 Holger Freyther 2007-07-10 17:23:17 PDT
Created attachment 15469 [details]
Move getMIMEType and getCharset to HTTPParsers, and one parse method from platform/net/cf

Same patch as the previous one. Adds the Copyright notice of apple and renames getCharset to parseCharset in the implementation.
Comment 7 Holger Freyther 2007-07-11 11:56:12 PDT
Created attachment 15476 [details]
Move getMIMEType and getCharset to HTTPParsers, and one parse method from platform/net/cf

Change function names, remove String parameter to follow the coding style. Change contentTypeString -> mediaType in the implementation.
Comment 8 Alexey Proskuryakov 2007-07-11 12:02:21 PDT
Comment on attachment 15476 [details]
Move getMIMEType and getCharset to HTTPParsers, and one parse method from platform/net/cf

r=me

+        Copy filenameFromHTTPContentDisposition to HTTPParsers as well. This parse

I'd say "move" here as well.
Comment 9 Mark Rowe (bdash) 2007-07-13 04:49:18 PDT
Landed in r24254.