Bug 35227 - REGRESSION (51566): HTTPHeaderMap::add(const char*, const String&) does not work
Summary: REGRESSION (51566): HTTPHeaderMap::add(const char*, const String&) does not work
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-21 21:03 PST by Yuta Kitamura
Modified: 2010-02-21 22:13 PST (History)
3 users (show)

See Also:


Attachments
HashMapTranslatorAdapter::translate() needs to set the mapped value. (1.34 KB, patch)
2010-02-21 21:06 PST, Yuta Kitamura
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yuta Kitamura 2010-02-21 21:03:07 PST
When I call HTTPHeaderMap::add(const char*, const String&) (for example, headerMap.add("Field-Name", String("field value"))), the field value is not recorded in the hash map, and I only get a null string by looking up the header field.

When I use HTTPHeaderMap::add(const AtomicString&, const String&), everything works as expected.

This is due to a bug in HashMapTranslatorAdapter::translate(), which does not save the mapped value.
Comment 1 Yuta Kitamura 2010-02-21 21:06:19 PST
Created attachment 49183 [details]
HashMapTranslatorAdapter::translate() needs to set the mapped value.
Comment 2 Darin Adler 2010-02-21 21:16:34 PST
Comment on attachment 49183 [details]
HashMapTranslatorAdapter::translate() needs to set the mapped value.

Yes, this bug was introduced by <http://trac.webkit.org/changeset/51566>.

How did you notice this bug? Does this have any effect on existing code, or only on the new code you are writing? Can you construct a test case, either manual or automated?

r=me
Comment 3 Yuta Kitamura 2010-02-21 21:34:19 PST
(In reply to comment #2)
> (From update of attachment 49183 [details])
> Yes, this bug was introduced by <http://trac.webkit.org/changeset/51566>.
> 
> How did you notice this bug? Does this have any effect on existing code, or
> only on the new code you are writing? Can you construct a test case, either
> manual or automated?
> 
> r=me

I found this bug when I was writing new code using HTTPHeaderMap. I don't know about any affected code of this bug.

To test this manually, try to call HTTPHeaderMap::add(const char*, const String&) and confirm the value is stored correctly. AFAIK there's no automatic test for this bug yet. A patch I'm writing now includes the code path that calls the above function, so this bug will be covered by the layout tests when my patch is committed.
Comment 4 WebKit Commit Bot 2010-02-21 22:12:58 PST
Comment on attachment 49183 [details]
HashMapTranslatorAdapter::translate() needs to set the mapped value.

Clearing flags on attachment: 49183

Committed r55068: <http://trac.webkit.org/changeset/55068>
Comment 5 WebKit Commit Bot 2010-02-21 22:13:02 PST
All reviewed patches have been landed.  Closing bug.