Skip to content

Commit 593c40a

Browse files
committed
playground: Use https to access snippet store.
Snippet store now supports https. Loading resources over https is always okay, even on pages served via http (the other way around is a problem). References: - https://developer.mozilla.org/en-US/docs/Web/Security/Mixed_content - https://developers.google.com/web/fundamentals/security/prevent-mixed-content/what-is-mixed-content - https://stackoverflow.com/q/20516584 Helps #37.
1 parent c3e6134 commit 593c40a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

‎playground/playground.go‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ type Line map[string]string
2323

2424
varoutput []Line
2525

26-
constsnippetStoreHost="snippets.gopherjs.org"
26+
constsnippetStoreHost="https://snippets.gopherjs.org"
2727

2828
funcmain(){
2929
varlocation=dom.GetWindow().Top().Location() // We might be inside an iframe, but want to use the location of topmost window.
@@ -36,7 +36,7 @@ func main(){
3636
ifstrings.HasPrefix(location.Hash, "#/"){
3737
id:=location.Hash[2:]
3838

39-
req:=xhr.NewRequest("GET", "http://"+snippetStoreHost+"/p/"+id)
39+
req:=xhr.NewRequest("GET", snippetStoreHost+"/p/"+id)
4040
req.ResponseType=xhr.ArrayBuffer
4141
gofunc(){
4242
err:=req.Send(nil)
@@ -230,7 +230,7 @@ func main(){
230230
})
231231

232232
scope.Set("share", func(){
233-
req:=xhr.NewRequest("POST", "http://"+snippetStoreHost+"/share")
233+
req:=xhr.NewRequest("POST", snippetStoreHost+"/share")
234234
req.ResponseType=xhr.ArrayBuffer
235235
gofunc(){
236236
err:=req.Send([]byte(scope.Get("code").String())) // Send as binary.
@@ -266,7 +266,7 @@ func main(){
266266
ifstrings.HasPrefix(location.Hash, "#/"){
267267
id:=location.Hash[2:]
268268

269-
req:=xhr.NewRequest("GET", "http://"+snippetStoreHost+"/p/"+id)
269+
req:=xhr.NewRequest("GET", snippetStoreHost+"/p/"+id)
270270
req.ResponseType=xhr.ArrayBuffer
271271
gofunc(){
272272
err:=req.Send(nil)

‎playground/playground.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
(0)