Hello. I am trying to serve sitemap.xml in the roo...
# ktor
m
Hello. I am trying to serve sitemap.xml in the root as https://example.com/sitemap.xml using
Copy code
routing {
   staticResources("/", "files")
}
When I call directly in the browser it works, but when I do:
curl -I <http://example.com/sitemap.xml>
The response is: HTTP/1.1 404 Not Found Content-Length: 853 Content-Type: text/html; charset=UTF-8 I suppose this content is from the Status Pages plugin:
Copy code
install(StatusPages) {
   statusFile(HttpStatusCode.NotFound, filePattern = "error#.html")
}
I have tried the same with curl in localhost with same results. Is this normal behaviour?
t
curl -I does a HEAD request instead of a GET, right? does the GET work? i assume this is releated to https://ktor.io/docs/server-static-content.html#autohead
m
@Thomas Urbanitsch thanks for your response, it worked.
🙌 1