premailer-rails icon indicating copy to clipboard operation
premailer-rails copied to clipboard

Add Accept header to requests in NetworkLoader

Open ElMassimo opened this issue 4 years ago • 1 comments

Description 📖

This pull request adds the Accept headers to requests made by the NetworkLoader strategy.

This allows development servers which can serve different file types—such as Vite.js—to serve a CSS file as expected.

This change should be backwards-compatible as any server that was previously responding with CSS content should continue to do so.

Background 📜

Vite.js can serve JS content for a given CSS file path, which allows it to provide hot-refresh for stylesheets.

For more information, see https://github.com/ElMassimo/vite_ruby/pull/93#issuecomment-865426710

ElMassimo avatar Jun 22 '21 00:06 ElMassimo

I was about to open it, thanks !

Intrepidd avatar Jun 22 '21 09:06 Intrepidd

Makes sense! Thanks for the PR.

fphilipe avatar Oct 16 '22 20:10 fphilipe