| Index: history/HistoryItem.cpp
|
| ===================================================================
|
| --- history/HistoryItem.cpp (revision 48585)
|
| +++ history/HistoryItem.cpp (working copy)
|
| @@ -447,10 +447,68 @@
|
| return m_formContentType;
|
| }
|
|
|
| +void HistoryItem::setHTTPHeaderField(const String& name, const String& value)
|
| +{
|
| + m_httpHeadersMap.set(name, value);
|
| +}
|
| +
|
| +const HTTPHeaderMap& HistoryItem::httpHeaderFields() const
|
| +{
|
| + return m_httpHeadersMap;
|
| +}
|
| +
|
| +bool HistoryItem::excludeHTTPHeaderFromStorage(const String& name) const
|
| +{
|
| + // All header names in this list must be in lower case.
|
| + static char* excludedList[] = {
|
| + "accept",
|
| + "accept-charset",
|
| + "accept-encoding",
|
| + "accept-language",
|
| + "accept-ranges",
|
| + "authorization",
|
| + "content-encoding",
|
| + "content-length",
|
| + "content-location",
|
| + "content-md5",
|
| + "content-range",
|
| + "content-type",
|
| + "cookie",
|
| + "expect",
|
| + "host",
|
| + "if-range",
|
| + "origin",
|
| + "proxy-authorization",
|
| + "range",
|
| + "referer",
|
| + "te",
|
| + "trailer",
|
| + "transfer-encoding",
|
| + "upgrade",
|
| + "user-agent",
|
| + "via",
|
| + };
|
| +
|
| + String nameLower = name.lower();
|
| + for (size_t i = 0; i < sizeof(excludedList) / sizeof(char*); ++i) {
|
| + if (nameLower == excludedList[i])
|
| + return true;
|
| + }
|
| + return false;
|
| +}
|
| +
|
| void HistoryItem::setFormInfoFromRequest(const ResourceRequest& request)
|
| {
|
| m_referrer = request.httpReferrer();
|
| -
|
| +
|
| + // Store HTTP headers
|
| + const HTTPHeaderMap& headerMap = request.httpHeaderFields();
|
| + HTTPHeaderMap::const_iterator it = headerMap.begin();
|
| + for (; it != headerMap.end(); ++it) {
|
| + if (!excludeHTTPHeaderFromStorage(it->first))
|
| + m_httpHeadersMap.set(it->first, it->second);
|
| + }
|
| +
|
| if (equalIgnoringCase(request.httpMethod(), "POST")) {
|
| // FIXME: Eventually we have to make this smart enough to handle the case where
|
| // we have a stream for the body to handle the "data interspersed with files" feature.
|
|
|