Skip to content

Instantly share code, notes, and snippets.

@tkaemming
Created May 2, 2016 18:34
Show Gist options
  • Save tkaemming/c3a57cd9d0b3377803c70d01866fb1d9 to your computer and use it in GitHub Desktop.
Save tkaemming/c3a57cd9d0b3377803c70d01866fb1d9 to your computer and use it in GitHub Desktop.
read a raw http payload (piped from from nc) for sentry and dump it as formatted json
import base64, json, sys, zlib
request = sys.stdin.read()
headers, payload = request.split('\r\n\r\n', 1)
result = json.loads(zlib.decompress(base64.b64decode(payload)))
sys.stdout.write(json.dumps(result, indent=2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment