responder
responder copied to clipboard
SPA index.html static file references are not served after change
Hi, first of all, great project!
I am running responder with Vue as frontend and Parcel as bundler, by serving the vue-generated ./static/index.html on the '/' route.
During development i run:
parcel watch ./app/index.html -d ./static/ --public-url /static
to automatically update the static files when the Vue codebase are changed.
When i try to force reload the page (without cached content) the updated static file are not served correctly and i receive this exception:
ERROR: Exception in ASGI application Traceback (most recent call last): File "/usr/lib/python3.7/site-packages/uvicorn/protocols/http/httptools_impl.py", line 375, in run_asgi result = await app(self.scope, self.receive, self.send) File "/usr/lib/python3.7/site-packages/uvicorn/middleware/asgi2.py", line 7, in __call__ await instance(receive, send) File "/usr/lib/python3.7/site-packages/starlette/middleware/wsgi.py", line 89, in __call__ await asyncio.wait_for(sender, None) File "/usr/lib/python3.7/asyncio/tasks.py", line 388, in wait_for return await fut File "/usr/lib/python3.7/site-packages/starlette/middleware/wsgi.py", line 104, in sender await send(message) File "/usr/lib/python3.7/site-packages/uvicorn/protocols/http/httptools_impl.py", line 504, in send raise RuntimeError("Response content shorter than Content-Length") RuntimeError: Response content shorter than Content-Length
Once the web server is restarted, the new files are served correctly.
Any insight is appreciated.
Can comfirm here. In my case it's an api, not static file. I got same exception in 2.0 version. 1.3.2 works fine. `
ERROR: Exception in ASGI application Traceback (most recent call last): File "xxxx/lib/python3.7/site-packages/uvicorn/protocols/http/httptools_impl.py", line 385, in run_asgi result = await app(self.scope, self.receive, self.send) File "xxxx/lib/python3.7/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in call return await self.app(scope, receive, send) File "xxxx/lib/python3.7/site-packages/responder/api.py", line 362, in call await self.app(scope, receive, send) File "xxxx/lib/python3.7/site-packages/starlette/middleware/sessions.py", line 75, in call await self.app(scope, receive, send_wrapper) File "xxxx/lib/python3.7/site-packages/starlette/middleware/errors.py", line 178, in call raise exc from None File "xxxx/lib/python3.7/site-packages/starlette/middleware/errors.py", line 156, in call await self.app(scope, receive, _send) File "xxxx/lib/python3.7/site-packages/starlette/middleware/cors.py", line 76, in call await self.app(scope, receive, send) File "xxxx/lib/python3.7/site-packages/starlette/middleware/trustedhost.py", line 34, in call await self.app(scope, receive, send) File "xxxx/lib/python3.7/site-packages/starlette/middleware/gzip.py", line 18, in call await responder(scope, receive, send) File "xxxx/lib/python3.7/site-packages/starlette/middleware/gzip.py", line 35, in call await self.app(scope, receive, self.send_with_gzip) File "xxxx/lib/python3.7/site-packages/starlette/exceptions.py", line 82, in call raise exc from None File "xxxx/lib/python3.7/site-packages/starlette/exceptions.py", line 71, in call await self.app(scope, receive, sender) File "xxxx/lib/python3.7/site-packages/responder/routes.py", line 324, in call await app(scope, receive, send) File "xxxx/lib/python3.7/site-packages/starlette/middleware/wsgi.py", line 62, in call await responder(receive, send) File "xxxx/lib/python3.7/site-packages/starlette/middleware/wsgi.py", line 91, in call await asyncio.wait_for(sender, None) File "xxxx/versions/3.7.4/lib/python3.7/asyncio/tasks.py", line 414, in wait_for return await fut File "xxxx/lib/python3.7/site-packages/starlette/middleware/wsgi.py", line 106, in sender await send(message) File "xxxx/lib/python3.7/site-packages/starlette/exceptions.py", line 68, in sender await send(message) File "xxxx/lib/python3.7/site-packages/starlette/middleware/gzip.py", line 93, in send_with_gzip await self.send(message) File "xxxx/lib/python3.7/site-packages/starlette/middleware/errors.py", line 153, in _send await send(message) File "xxxx/lib/python3.7/site-packages/uvicorn/protocols/http/httptools_impl.py", line 507, in send raise RuntimeError("Response content longer than Content-Length") RuntimeError: Response content longer than Content-Length `