Browse Source

add response status code to headers.json

Nick Sweeting 4 years ago
parent
commit
c089501073
1 changed files with 7 additions and 1 deletions
  1. 7 1
      archivebox/util.py

+ 7 - 1
archivebox/util.py

@@ -200,7 +200,13 @@ def get_headers(url: str, timeout: int=None) -> str:
             stream=True
             stream=True
         )
         )
     
     
-    return pyjson.dumps(dict(response.headers), indent=4)
+    return pyjson.dumps(
+        {
+            'Status-Code': response.status_code,
+            **dict(response.headers),
+        },
+        indent=4,
+    )
 
 
 
 
 @enforce_types
 @enforce_types