ソースを参照

NZBGet socks fixes

HalianElf 5 年 前
コミット
6b01c4317a
2 ファイル変更2 行追加2 行削除
  1. 1 1
      api/classes/organizr.class.php
  2. 1 1
      api/v2/routes/socks.php

+ 1 - 1
api/classes/organizr.class.php

@@ -6051,7 +6051,7 @@ class Organizr
 		if (!$error) {
 			$pre = explode('/api/v2/socks/', $requestObject->getUri()->getPath());
 			$endpoint = explode('/', $pre[1]);
-			$new = str_ireplace($endpoint[0], '', $pre[1]);
+			$new = urldecode(preg_replace('/'.$endpoint[0].'/', '', $pre[1], 1));
 			$getParams = ($_GET) ? '?' . http_build_query($_GET) : '';
 			$url = $this->qualifyURL($this->config[$url]) . $new . $getParams;
 			$url = $this->cleanPath($url);

+ 1 - 1
api/v2/routes/socks.php

@@ -30,7 +30,7 @@ $app->any('/socks/{app}/{route:.*}', function ($request, $response, $args) {
 			$url = 'nzbgetURL';
 			$enabled = 'nzbgetSocksEnabled';
 			$auth = 'nzbgetSocksAuth';
-			$header = null;
+			$header = 'Authorization';
 			break;
 		default:
 			$Organizr->setAPIResponse('error', 'Application not supported for socks', 404);