Bug 254158 - httpHeaderField always returns string
Summary: httpHeaderField always returns string
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-03-20 08:31 PDT by Anne van Kesteren
Modified: 2023-03-20 09:04 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anne van Kesteren 2023-03-20 08:31:56 PDT
This makes it impossible to distinguish between a missing header and a header that is present whose value is the empty string.

It would be better if we were precise about this as Fetch and HTTP are too.
Comment 1 Radar WebKit Bug Importer 2023-03-20 08:32:05 PDT
<rdar://problem/106944735>
Comment 2 Chris Dumez 2023-03-20 08:35:08 PDT
String has a null state in WebKit.

This should be distinguishable already. `string.isNull()` -> header is missing. `string.isEmpty() && !string.isNull()` -> header is present but has no value.
Comment 3 Chris Dumez 2023-03-20 08:35:32 PDT
I suggest we mark this bug as invalid unless I missed something.
Comment 4 Chris Dumez 2023-03-20 08:39:21 PDT
You could also use `httpHeaderFields().contains()`.
Comment 5 youenn fablet 2023-03-20 08:48:41 PDT
The bug is more that, apparently, some code paths are using isEmpty() while they should probably use isNull().
Comment 6 Anne van Kesteren 2023-03-20 09:04:17 PDT
Ah, I didn't realize that! Let's close this as INVALID then. I'll follow-up with more detailed bugs as I come across things.