wwhtrbbtt / TrackMe

Home Page:https://tls.peet.ws

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CORS support

deviceidio opened this issue · comments

hi I have been trying to add CORS to this project and just can't get it to work.. any idea how I could do that ?
update:
I added the following line to the connection_handler.go file in the HandleHTTP2 method:
encoder.WriteField(hpack.HeaderField{Name: "Access-Control-Allow-Origin", Value: "*"})
It solved the CORS problem but I get the following error: ERR_HTTP2_PROTOCOL_ERROR

http2 headers must be lowercase

commented

I wont add this myself, because I do not want websites to be able to embed the API (at least not my instance) to prevent too many people relying on it, and to prevent "abuse" in form of data-collectors.
Good catch though, yes, the headers must be lowercased