mirror of
https://github.com/servo/servo.git
synced 2025-08-12 08:55:32 +01:00
Headers API constructor and methods
- Reworked the append method to support the inner `hyper::header::Headers`'s HashMap `insert` method, which overwrites entries instead of appending. - Filled out constructor as well as delete, get, has, and set methods. - Updated relevant test expectations
This commit is contained in:
parent
8a09a0369f
commit
e631d3a5f6
6 changed files with 156 additions and 76 deletions
|
@ -4,19 +4,21 @@
|
|||
|
||||
// https://fetch.spec.whatwg.org/#headers-class
|
||||
|
||||
/* typedef (Headers or sequence<sequence<ByteString>>) HeadersInit; */
|
||||
|
||||
/* [Constructor(optional HeadersInit init),*/
|
||||
[Exposed=(Window,Worker)]
|
||||
// TODO support OpenEndedDictionary<ByteString>
|
||||
typedef (Headers or sequence<sequence<ByteString>>) HeadersInit;
|
||||
|
||||
[Constructor(optional HeadersInit init),
|
||||
Exposed=(Window,Worker)]
|
||||
interface Headers {
|
||||
[Throws]
|
||||
void append(ByteString name, ByteString value);
|
||||
[Throws]
|
||||
void delete(ByteString name);
|
||||
[Throws]
|
||||
ByteString? get(ByteString name);
|
||||
[Throws]
|
||||
boolean has(ByteString name);
|
||||
[Throws]
|
||||
void set(ByteString name, ByteString value);
|
||||
// iterable<ByteString, ByteString>; // TODO see issue #12628
|
||||
};
|
||||
|
||||
/* void delete(ByteString name);
|
||||
* ByteString? get(ByteString name);
|
||||
* boolean has(ByteString name);
|
||||
* void set(ByteString name, ByteString value);
|
||||
* iterable<ByteString, ByteString>;
|
||||
* }; */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue