浏览代码

Update NodeinfoService, disable redirects

Daniel Supernault 1 年之前
父节点
当前提交
240e6bbe4f
共有 1 个文件被更改,包括 8 次插入2 次删除
  1. 8 2
      app/Services/NodeinfoService.php

+ 8 - 2
app/Services/NodeinfoService.php

@@ -22,7 +22,10 @@ class NodeinfoService
         $wk = $url . '/.well-known/nodeinfo';
 
         try {
-            $res = Http::withHeaders($headers)
+            $res = Http::withOptions([
+                'allow_redirects' => false,
+            ])
+            ->withHeaders($headers)
             ->timeout(5)
             ->get($wk);
         } catch (RequestException $e) {
@@ -61,7 +64,10 @@ class NodeinfoService
         }
 
         try {
-            $res = Http::withHeaders($headers)
+            $res = Http::withOptions([
+                'allow_redirects' => false,
+            ])
+            ->withHeaders($headers)
             ->timeout(5)
             ->get($href);
         } catch (RequestException $e) {