浏览代码

sitemap.xml HEAD 요청 405 수정

정적 파일일 때는 StaticFiles 미들웨어가 HEAD 를 처리했으나 어트리뷰트 라우팅에
HttpGet 만 두어 HEAD 가 405 를 반환했다. HttpHead 를 추가한다.
(구글 sitemap 수집은 GET 이라 색인에는 영향 없었고, HEAD 로 점검하는 모니터링 도구용)

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
KIM-JINO5 2 周之前
父节点
当前提交
9ecd083925
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      Controllers/SitemapController.cs

+ 3 - 0
Controllers/SitemapController.cs

@@ -21,7 +21,10 @@ namespace goods.Controllers
             _configuration = configuration;
         }
 
+        // HEAD 도 함께 받는다. 정적 파일일 때는 StaticFiles 미들웨어가 HEAD 를 처리해 줬지만
+        // 어트리뷰트 라우팅은 HttpGet 만 두면 HEAD 요청에 405 를 반환한다.
         [HttpGet("/sitemap.xml")]
+        [HttpHead("/sitemap.xml")]
         [ResponseCache(Duration = 3600, Location = ResponseCacheLocation.Any)]
         public IActionResult Index()
         {