Sfoglia il codice sorgente

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

CauseFX 4 anni fa
parent
commit
d596d61589
1 ha cambiato i file con 5 aggiunte e 0 eliminazioni
  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);