Skip to content

Commit

Permalink
Hook check for errors
Browse files Browse the repository at this point in the history
- Fix js injection breaking when there is an error
  • Loading branch information
ElianHugh committed Jun 7, 2024
1 parent 4d35ef8 commit 4d7dc43
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions R/middleware.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ middleware <- function(engine) {

postserialise_hotwater <- function(js) {
function(value) {
if (length(value$error) > 0L) {
return(value)
}
if (grepl("text/html", value$headers[["Content-Type"]])) {
value$headers[["Cache-Control"]] <- "no-cache"
value$body <- c(value$body, js) |>
Expand Down

0 comments on commit 4d7dc43

Please sign in to comment.