Fix for the new server's reply

Just when I was about to deploy it they changed the
server to return HTTP/2... lol
No big deal (I think), fix the http header parser so
if the "OK" message string is missing it'll keep
parsing.
This commit is contained in:
King_DuckZ 2020-09-04 01:17:59 +01:00
parent b768015b52
commit c98083837d
2 changed files with 16 additions and 17 deletions

View file

@ -1,17 +1,16 @@
HTTP/1.1 200 OK
Date: Mon, 22 Jun 2020 13:16:00 GMT
Content-Type: application/json
Content-Length: 89
Connection: keep-alive
Set-Cookie: __cfduid=db00b974d1175c5928b2e1378398395291592831760; expires=Wed, 22-Jul-20 13:16:00 GMT; path=/; domain=.originsro.org; HttpOnly; SameSite=Lax
X-RateLimit-Limit: 2
X-RateLimit-Remaining: 1
X-RateLimit-Reset: 1592831771
Retry-After: 10
CF-Cache-Status: DYNAMIC
cf-request-id: 037dc4f1fe0000074eb9af4200000001
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Server: cloudflare
CF-RAY: 5a763dc99efa074e-LHR
HTTP/2 200
date: Fri, 04 Sep 2020 00:08:24 GMT
content-type: application/json
content-length: 89
set-cookie: __cfduid=d58ca1bc3de8452dca4695f92e7a685171599178104; expires=Sun, 04-Oct-20 00:08:24 GMT; path=/; domain=.originsro.org; HttpOnly; SameSite=Lax
x-ratelimit-limit: 2
x-ratelimit-remaining: 1
x-ratelimit-reset: 1599178115
retry-after: 10
cf-cache-status: DYNAMIC
cf-request-id: 04f80a74c90000077a3994a200000001
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
server: cloudflare
cf-ray: 5cd379ce0ba9077a-LHR
{"generation_timestamp":"2020-06-22T13:16:00.927871+00:00","message":"pong","version":1}
{"generation_timestamp":"2020-09-04T00:08:24.038003+00:00","message":"pong","version":1}

View file

@ -91,7 +91,7 @@ auto const header_entry_def =
x3::rule<class HttpHeaderRule, ParsedHeader> http_header = "http_header";
auto const http_header_def =
no_skip[lit("HTTP/") >> raw[+digit >> -(string(".") >> +digit)]] > uint_ >
raw[lexeme[+(char_ - eol)]] > eol >>
-raw[lexeme[+(char_ - eol)]] > eol >>
(header_entry % eol)
;