mirror of https://github.com/adamdruppe/arsd.git
issue 275
This commit is contained in:
parent
9c8699c2b4
commit
8e89224e88
18
http2.d
18
http2.d
|
@ -2760,6 +2760,11 @@ class WebSocket {
|
|||
if(config.origin.length)
|
||||
append("Origin: ", origin, "\r\n");
|
||||
|
||||
foreach(h; config.additionalHeaders) {
|
||||
append(h);
|
||||
append("\r\n");
|
||||
}
|
||||
|
||||
append("\r\n");
|
||||
|
||||
auto remaining = buffer[0 .. pos];
|
||||
|
@ -3003,6 +3008,19 @@ class WebSocket {
|
|||
string origin; /// Origin URL to send with the handshake, if desired.
|
||||
string protocol; /// the protocol header, if desired.
|
||||
|
||||
/++
|
||||
Additional headers to put in the HTTP request. These should be formatted `Name: value`, like for example:
|
||||
|
||||
---
|
||||
Config config;
|
||||
config.additionalHeaders ~= "Authorization: Bearer your_auth_token_here";
|
||||
---
|
||||
|
||||
History:
|
||||
Added February 19, 2021 (included in dub version 9.2)
|
||||
+/
|
||||
string[] additionalHeaders;
|
||||
|
||||
int pingFrequency = 5000; /// Amount of time (in msecs) of idleness after which to send an automatic ping
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue