wwhtrbbtt / TrackMe

https://tls.peet.ws
GNU General Public License v3.0
208 stars 32 forks source link

CORS support #18

Closed deviceidio closed 4 months ago

deviceidio commented 5 months ago

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

0xffffa commented 3 months ago

http2 headers must be lowercase

wwhtrbbtt commented 3 months ago

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