Skip to content

Styles still rendering when using NewCSSMiddleware? #659

Closed Answered by a-h
Linkinlog asked this question in Q&A
Discussion options

You must be logged in to vote

I can see the issue now.

The way that the CSS middleware determines whether the CSS has already been rendered or not, is by setting the HTTP context.

However, you're passing context.Background() instead of passing the r.Context() down through the template Render function.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Linkinlog
Comment options

@a-h
Comment options

a-h Apr 2, 2024
Maintainer

Answer selected by Linkinlog
@Linkinlog
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants