loansindi / ps1rfid

Golang RFID authentication for ps1auth
GNU General Public License v3.0
13 stars 11 forks source link

Access-Control-Allow-Origin Support please #14

Closed ludagoo closed 8 years ago

loansindi commented 9 years ago

can you give me more details on what this means?

ludagoo commented 9 years ago

Essentially a legit HTTP header including Access-Control-Allow-Origin so that we can do fun stuff in JS from the member site I think it is done with w.Header().Set("Access-Control-Allow-Origin", "*") I think changing main.go like so:

    go http.HandleFunc("/open", func(w http.ResponseWriter, r *http.Request) {
        w.Header().Set("Access-Control-Allow-Origin", "*")
        w.Write([]byte("Okay"))
        openDoor(*splate, publisher)

If that works we could change "*" to specifically the member site

loansindi commented 9 years ago

If you find me in the space some day that's not a tuesday evening, I can show you how I'm doing deployment on these (while implementing this change), if you'd like.

ludagoo commented 9 years ago

ok