Hello all,
I’m new to this Stimulus+TurboStreams stuff, and positively impressed so far.
The surprize came in production - the formerly well-running pages do no longer create+update, but attach the created/updated page below the original. And this happens with genuine controller actions, both with render and redirect:
def create
@akzept = Akzept.new(akzept_params)
if @akzept.save
redirect_to @akzept
else
render :new, status: 422
end
end
Narrowing it down, there is a frontrunning reverse proxy, and it must relocate the script-url, from internally http://app.intra.example.org:8765/
to https://example.org/myapp/
.
That one didn’t like to relocate urls in streams, because it wants to process text/html
, and only that, and it always sets the content to text/html
after processing. So I taught it to do otherwise:
SetEnvIf Accept "text\/vnd.turbo-stream.html" PROXY_HTML_FORCE=turbostream
Header edit Content-Type "text\/html" text/vnd.turbo-stream.html \
"expr=reqenv('PROXY_HTML_FORCE') == 'turbostream'"
Now that is apparently an overkill. How can it be done otherwise?
Basically I need the request to somehow tell me if it runs a partial or a full page.