feat: add support for application/tlsrpt+gzip
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
s3lph 2023-07-24 01:49:40 +02:00
parent bef1b64af7
commit 38fe3a49c1
Signed by: s3lph
GPG key ID: 0AA29A52FB33CFB5

View file

@ -2,6 +2,7 @@
import argparse
import os
import dataclasses
import gzip
import json
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+json')
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:
self.handle(json.load(bottle.request.body))
else: