소스 검색

Merge pull request #1277 from Zwyx/add-header

Add response header `X-Uncompressed-Content-Length` for JSON API
El RIDO 2 년 전
부모
커밋
b75aee6834
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      lib/Controller.php

+ 2 - 0
lib/Controller.php

@@ -151,6 +151,8 @@ class Controller
             header('Access-Control-Allow-Origin: *');
             header('Access-Control-Allow-Methods: GET, POST, PUT, DELETE');
             header('Access-Control-Allow-Headers: X-Requested-With, Content-Type');
+            header('X-Uncompressed-Content-Length: ' . strlen($this->_json));
+            header('Access-Control-Expose-Headers: X-Uncompressed-Content-Length');
             echo $this->_json;
         } else {
             $this->_view();