1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:38:11 +00:00

LibWeb: Add support for XMLHttpRequest request headers

Implement XMLHttpRequest.setRequestHeader() and include the headers in
the outgoing HTTP request.
This commit is contained in:
Andreas Kling 2021-01-18 14:01:05 +01:00
parent 0639e77898
commit c99e35485a
4 changed files with 33 additions and 1 deletions

View file

@ -62,6 +62,8 @@ public:
void open(const String& method, const String& url);
void send();
void set_request_header(const String& header, const String& value);
private:
virtual void ref_event_target() override { ref(); }
virtual void unref_event_target() override { unref(); }
@ -79,6 +81,8 @@ private:
String m_method;
String m_url;
HashMap<String, String, CaseInsensitiveStringTraits> m_request_headers;
ByteBuffer m_response;
};