0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-02 10:08:56 +02:00

ircd: Fix/improve response header related.

This commit is contained in:
Jason Volk 2018-01-11 18:46:04 -08:00
parent 04fa556c58
commit d151d96d83

View file

@ -596,7 +596,7 @@ ircd::resource::response::response(client &client,
const fmt::bsprintf<64> rtime
{
"%zdus", request_time
"%zd$us", request_time
};
const string_view cache_control
@ -619,12 +619,20 @@ ircd::resource::response::response(client &client,
content_type,
headers,
{
{ "Access-Control-Allow-Origin", "*" }, //TODO: XXX
{ "Cache-Control", cache_control },
{ "X-IRCd-Request-Timer", rtime, },
{ "Access-Control-Allow-Origin", "*" }, //TODO: XXX
{ "Cache-Control", cache_control },
{ "X-IRCd-Request-Timer", rtime, },
},
};
// Maximum size is 2_KiB which is realistically ok but ideally a small
// maximum; this exception should hit the developer in testing.
if(unlikely(!head.remaining()))
throw assertive
{
"HTTP headers too large for buffer of %zu", sizeof(head_buf)
};
const ilist<const const_buffer> vector
{
head.completed(),