fasthx
fasthx copied to clipboard
Page routes cannot have a Request dependency
Page routes cannot have a Request dependency injected.
The root cause is fastapi/fastapi#12403.
See also MR #34 for one possible workaround fix.
Just as an FYI: If this workaround is applied, it should also be applied to the hx decorator, because with the current "return request if header is set" solution, the jinja context gets a "None" object for the key "request".
This is last point was discovered after the initial MR was a made, due to me using the request object for some debug info in a template and finding out it's None in some cases. (In particular also error templates.)