Преглед изворни кода

fixed issue with socks api not forwarding content type if set
added socks debug output for api socks response

CauseFX пре 4 година
родитељ
комит
d596d61589
1 измењених фајлова са 5 додато и 0 уклоњено
  1. 5 0
      api/classes/organizr.class.php

+ 5 - 0
api/classes/organizr.class.php

@@ -6286,6 +6286,10 @@ class Organizr
 					$headers[$header] = $headerKey;
 				}
 			}
+			if ($requestObject->hasHeader('Content-Type')) {
+				$headerKey = $requestObject->getHeaderLine('Content-Type');
+				$headers['Content-Type'] = $headerKey;
+			}
 			$debugInformation = [
 				'type' => $requestObject->getMethod(),
 				'headerType' => $requestObject->getHeaderLine('Content-Type'),
@@ -6314,6 +6318,7 @@ class Organizr
 					default:
 						$call = Requests::get($url, $headers, $options);
 				}
+				$this->logger->debug('Socks Response', $this->json_validator($call->body) ? json_decode($call->body, true) : $call->body);
 				return $call->body;
 			} catch (Requests_Exception $e) {
 				$this->setAPIResponse('error', $e->getMessage(), 500);