File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -119,19 +119,22 @@ private function doLogToSpeedscopeService(
119119 $ data ['memory_peak_allocated_bytes ' ] = memory_get_peak_usage ( true );
120120
121121 $ client = new Client ();
122+ $ body = json_encode ( [
123+ 'id ' => $ id ,
124+ 'wiki ' => $ wgDBname ?? 'unknown ' ,
125+ 'url ' => $ requestUri ,
126+ 'cfRay ' => $ requestContext ->getRequest ()->getHeader ( 'Cf-Ray ' ) ?: 'unknown ' ,
127+ 'forced ' => $ forced ,
128+ 'speedscopeData ' => json_encode ( $ data ),
129+ 'parserReport ' => $ parserReport ? json_encode ( $ parserReport ) : null ,
130+ 'environment ' => $ environment ,
131+ ] );
122132 $ options = [
123- RequestOptions::JSON => [
124- 'id ' => $ id ,
125- 'wiki ' => $ wgDBname ?? 'unknown ' ,
126- 'url ' => $ requestUri ,
127- 'cfRay ' => $ requestContext ->getRequest ()->getHeader ( 'Cf-Ray ' ) ?: 'unknown ' ,
128- 'forced ' => $ forced ,
129- 'speedscopeData ' => json_encode ( $ data ),
130- 'parserReport ' => $ parserReport ? json_encode ( $ parserReport ) : null ,
131- 'environment ' => $ environment ,
132- ],
133+ RequestOptions::BODY => gzencode ( $ body ),
133134 RequestOptions::HEADERS => [
134135 'Authorization ' => 'Bearer ' . $ token ,
136+ 'Content-Encoding ' => 'gzip ' ,
137+ 'Content-Type ' => 'application/json ' ,
135138 ],
136139 ];
137140 try {
You can’t perform that action at this time.
0 commit comments