瀏覽代碼

add response status code to headers.json

Nick Sweeting 4 年之前
父節點
當前提交
c089501073
共有 1 個文件被更改,包括 7 次插入1 次删除
  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
         )
     
-    return pyjson.dumps(dict(response.headers), indent=4)
+    return pyjson.dumps(
+        {
+            'Status-Code': response.status_code,
+            **dict(response.headers),
+        },
+        indent=4,
+    )
 
 
 @enforce_types