SHARE
TWEET

Untitled

a guest Nov 14th, 2017 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. func ResponseWithJSON(w http.ResponseWriter, json []byte, code int) {
  2.     w.Header().Set("Content-Type", "application/json; charset=utf-8")
  3.     w.Header().Set("Access-Control-Allow-Origin", "*")
  4.     w.WriteHeader(code)
  5.     w.Write(json)
  6. }
  7.    
  8. w.Header().Set("Access-Control-Allow-Origin", "http://www.example.com")
  9.    
  10. w.Header().Set("Access-Control-Allow-Origin", "http://example.com")
  11.    
  12. w.Header().Set("Access-Control-Allow-Origin", "http://www.example.com,http://example.com")
  13.    
  14. w.Header().Set("Access-Control-Allow-Origin", "http://www.example.com")
  15. w.Header().Set("Access-Control-Allow-Origin", "http://example.com")
RAW Paste Data
Top