Skip to content

Commit 30ce490

Browse files
authored
Fix CORS error.
Without the `https` prefix chrome throws the following error ``` 5-http.elm.html:8390 XMLHttpRequest cannot load file://api.giphy.com/v1/gifs/random?api_key=dc6zaTOxFJmzC&tag=cats. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource. ```
1 parent c99db77 commit 30ce490

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/5-http.elm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ getRandomGif : String -> Cmd Msg
8888
getRandomGif topic =
8989
let
9090
url =
91-
"//api.giphy.com/v1/gifs/random?api_key=dc6zaTOxFJmzC&tag=" ++ topic
91+
"https://api.giphy.com/v1/gifs/random?api_key=dc6zaTOxFJmzC&tag=" ++ topic
9292
in
9393
Task.perform FetchFail FetchSucceed (Http.get decodeGifUrl url)
9494

0 commit comments

Comments
 (0)