feat: add support for application/tlsrpt+gzip
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
bef1b64af7
commit
38fe3a49c1
1 changed files with 2 additions and 1 deletions
|
@ -2,6 +2,7 @@
|
||||||
import argparse
|
import argparse
|
||||||
import os
|
import os
|
||||||
import dataclasses
|
import dataclasses
|
||||||
|
import gzip
|
||||||
import json
|
import json
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
|
@ -47,7 +48,7 @@ class Reporter(bottle.Bottle):
|
||||||
bottle.response.add_header('Accept', 'application/tlsrpt+gzip')
|
bottle.response.add_header('Accept', 'application/tlsrpt+gzip')
|
||||||
bottle.response.add_header('Accept', 'application/tlsrpt+json')
|
bottle.response.add_header('Accept', 'application/tlsrpt+json')
|
||||||
if 'application/tlsrpt+gzip' in bottle.request.content_type:
|
if 'application/tlsrpt+gzip' in bottle.request.content_type:
|
||||||
self.handle(self.decompress(bottle.request.body))
|
self.handle(json.load(gzip.open(bottle.request.body)))
|
||||||
elif 'application/tlsrpt+json' in bottle.request.content_type:
|
elif 'application/tlsrpt+json' in bottle.request.content_type:
|
||||||
self.handle(json.load(bottle.request.body))
|
self.handle(json.load(bottle.request.body))
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue