Skip to content

playground: Use https to access snippet store. #62

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions playground/playground.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type Line map[string]string

var output []Line

const snippetStoreHost = "snippets.gopherjs.org"
const snippetStoreHost = "https://snippets.gopherjs.org"

func main() {
var location = dom.GetWindow().Top().Location() // We might be inside an iframe, but want to use the location of topmost window.
Expand All @@ -36,7 +36,7 @@ func main() {
if strings.HasPrefix(location.Hash, "#/") {
id := location.Hash[2:]

req := xhr.NewRequest("GET", "http://"+snippetStoreHost+"/p/"+id)
req := xhr.NewRequest("GET", snippetStoreHost+"/p/"+id)
req.ResponseType = xhr.ArrayBuffer
go func() {
err := req.Send(nil)
Expand Down Expand Up @@ -230,7 +230,7 @@ func main() {
})

scope.Set("share", func() {
req := xhr.NewRequest("POST", "http://"+snippetStoreHost+"/share")
req := xhr.NewRequest("POST", snippetStoreHost+"/share")
req.ResponseType = xhr.ArrayBuffer
go func() {
err := req.Send([]byte(scope.Get("code").String())) // Send as binary.
Expand Down Expand Up @@ -266,7 +266,7 @@ func main() {
if strings.HasPrefix(location.Hash, "#/") {
id := location.Hash[2:]

req := xhr.NewRequest("GET", "http://"+snippetStoreHost+"/p/"+id)
req := xhr.NewRequest("GET", snippetStoreHost+"/p/"+id)
req.ResponseType = xhr.ArrayBuffer
go func() {
err := req.Send(nil)
Expand Down
2 changes: 1 addition & 1 deletion playground/playground.js

Large diffs are not rendered by default.