4 ms·
I will need some headers like content-type too. https://unix4lyfe.org/darkhttpd/ https://unix4lyfe.org/darkhttpd/ darkhttpd is a simple (3k lines of C, no deps)
by souenzzo 8y ago
I will need some headers like content-type too.
https://unix4lyfe.org/darkhttpd/ https://unix4lyfe.org/darkhttpd/
darkhttpd is a simple (3k lines of C, no deps) HTTP server that handles headers and encoding. may be a good case to study.
- clusmore 8y agoThanks for sharing that, I'll give it a look. I think that http.ServeFile handles content type automatically, because when I test this locally I'm seeing Content-Type in the response headers.
- souenzzo 8y agoOh. Nice. There is a content-type header. And also the "Content-Length". The only relevant header that is missing is the "Access-Control-Allow-Origin: *" That comes from github but not from you server. In 404, github sends Content-Security-Policy: default-src 'none'; style-src 'unsafe-inline'; img-src data:; connect-src 'self'
- clusmore 8y agoAwesome, thanks for noting this. I've raised an issue to address this and investigate other response header differences: https://github.com/CurtisLusmore/ghp/issues/4 https://github.com/CurtisLusmore/ghp/issues/4