Created
September 25, 2022 15:04
-
-
Save percybolmer/fa27e294438534e5992c4d0b29d70aae to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// checkOrigin will check origin and return true if its allowed | |
func checkOrigin(r *http.Request) bool { | |
// Grab the request origin | |
origin := r.Header.Get("Origin") | |
switch origin { | |
// Update this to HTTPS | |
case "https://localhost:8080": | |
return true | |
default: | |
return false | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment