From 16b5fb3533b5830e1a9fa49d52f666cb63270d43 Mon Sep 17 00:00:00 2001 From: shibafu Date: Tue, 21 Jul 2020 23:39:48 +0900 Subject: [PATCH] =?UTF-8?q?Tissue=E5=86=85=E3=81=AEURL=E3=81=AB=E5=AF=BE?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=83=A1=E3=82=BF=E3=83=87=E3=83=BC=E3=82=BF?= =?UTF-8?q?=E5=8F=96=E5=BE=97=E3=81=AF=E6=8B=92=E5=90=A6=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/MetadataResolveService.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Services/MetadataResolveService.php b/app/Services/MetadataResolveService.php index 405ae9f..55372bd 100644 --- a/app/Services/MetadataResolveService.php +++ b/app/Services/MetadataResolveService.php @@ -27,6 +27,11 @@ class MetadataResolveService // URLの正規化 $url = $this->formatter->normalizeUrl($url); + // 自分自身は解決しない + if (parse_url($url, PHP_URL_HOST) === parse_url(config('app.url'), PHP_URL_HOST)) { + abort(403); + } + // 無かったら取得 // TODO: ある程度古かったら再取得とかありだと思う $metadata = Metadata::find($url);