Browse files

Take care of hash key randomization.

Make sure certain maps destined for JSON encoding get sorted
after being turned into lists. If they're already a list when they
get serialized, the sort_key option won't handle them, so we need
to do it manually.
  • Loading branch information...
Andrew Fleenor
Andrew Fleenor committed Dec 14, 2012
1 parent d1d4b17 commit 4e182c650f0d2a188d061859753433fc474b7b00
@@ -1,4 +1,4 @@
+#!/usr/bin/env python
Main program that converts pcaps to HAR's.
@@ -12,15 +12,15 @@ def header_json_repr(d):
'name': k,
'value': v
- } for k, v in d.iteritems()
+ } for k, v in sorted(d.iteritems())
def query_json_repr(d):
# d = {string: [string]}
# we need to print all values of the list
output = []
- for k, l in d.iteritems():
+ for k, l in sorted(d.iteritems()):
for v in l:
'name': k,
Oops, something went wrong.

0 comments on commit 4e182c6

Please sign in to comment.