Skip to content

Commit a8df45b

Browse files
authored
Fix missing newline in robots.txt response. (#222)
1 parent b681a60 commit a8df45b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/meta.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,5 +244,5 @@ function serve_parents(http::HTTP.Stream)
244244
end
245245

246246
function serve_robots_txt(http::HTTP.Stream)
247-
return serve_data(http, "User-agent: * Disallow: /\n", "text/plain")
247+
return serve_data(http, "User-agent: *\nDisallow: /\n", "text/plain")
248248
end

test/tests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ end
104104

105105
response = HTTP.get("$(server_url)/robots.txt")
106106
@test response.status == 200
107-
@test chomp(String(response.body)) == "User-agent: * Disallow: /"
107+
@test String(response.body) == "User-agent: *\nDisallow: /\n"
108108

109109
# Ensure that some random URL gets a 404
110110
@test_throws HTTP.ExceptionRequest.StatusError HTTP.get("$(server_url)/docs")

0 commit comments

Comments
 (0)