3 ms·
The author specifically mentions static websites, which wouldn't have the functionality to alter the HTML.
by jaywalk 4y ago
The author specifically mentions static websites, which wouldn't have the functionality to alter the HTML.
- anentropic 4y agoif it's served via a CDN then it may be possible there, they often have facilities to transform the content based on headers etc
- superkuh 4y agoYou can specify HTTP headers for a path/location in nginx in a static website and have it include arbitrary headers. Most standards respecting browsers (like Firefox) accept HTTP header specified CSS like, #/etc/nginx/sites-enabled/whatever.conf location /this-isnt-for-you.html { add_header Link "<//site.com/isntforyouheader.css>; REL=stylesheet"; } $ curl -I http://site.com/this-isnt-for-you.html curl -I site.com HTTP/1.1 200 OK Server: nginx Date: Mon, 28 Nov 2022 18:08:01 GMT Content-Type: text/html Connection: keep-alive Link: <//site.com/isntforyouheader.css>; REL=stylesheet ... This works to set CSS atributes only for a specific URL on my static websites using .html files. For nginx. But nginx is a very common and secure choice for static sites and available in everyone's repos. And you can probably add arbitrary headers per path with other static webservers configs too.