Skip to content

Commit

Permalink
Fix origin validation in playground server for localhost (#12599)
Browse files Browse the repository at this point in the history
  • Loading branch information
straight-shoota authored Oct 14, 2022
1 parent 7bede60 commit 0fac5d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/compiler/crystal/tools/playground/server.cr
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ module Crystal::Playground

private def accept_request?(origin)
case @host
when nil
when nil, "localhost", "127.0.0.1"
origin == "http://127.0.0.1:#{@port}" || origin == "http://localhost:#{@port}"
when "0.0.0.0"
true
Expand Down

0 comments on commit 0fac5d5

Please sign in to comment.