Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DM-40656] Update dependencies / fix a bug #81

Merged
merged 5 commits into from
Sep 7, 2023
Merged

Commits on Sep 5, 2023

  1. Configuration menu
    Copy the full SHA
    614374f View commit details
    Browse the repository at this point in the history
  2. [DM-40656] Fix spelling error

    cbanek committed Sep 5, 2023
    Configuration menu
    Copy the full SHA
    2a55b0b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c5a5d95 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1371575 View commit details
    Browse the repository at this point in the history

Commits on Sep 7, 2023

  1. [DM-40656] Fix bug where "Response content shorter than Content-Length"

    When serving a file that should be cached on the other side (and
    crawlspace returns a 304) we return the Content-Length of the cached
    file instead of the Content-Length of the 304 message.  This makes
    python emit the following error:
    
    INFO:     68.230.27.252:40976 - "GET /api/hips/images/band_z/Norder11/Dir35540000/Npix35543833.png HTTP/1.1" 304 Not Modified
    ERROR:    Exception in ASGI application
    Traceback (most recent call last):
      File "/opt/venv/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 419, in run_asgi
        result = await app(  # type: ignore[func-returns-value]
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/venv/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
        return await self.app(scope, receive, send)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/venv/lib/python3.11/site-packages/fastapi/applications.py", line 270, in __call__
        await super().__call__(scope, receive, send)
      File "/opt/venv/lib/python3.11/site-packages/starlette/applications.py", line 124, in __call__
        await self.middleware_stack(scope, receive, send)
      File "/opt/venv/lib/python3.11/site-packages/starlette/middleware/errors.py", line 184, in __call__
        raise exc
      File "/opt/venv/lib/python3.11/site-packages/starlette/middleware/errors.py", line 162, in __call__
        await self.app(scope, receive, _send)
      File "/opt/venv/lib/python3.11/site-packages/starlette/middleware/base.py", line 107, in __call__
        await response(scope, receive, send)
      File "/opt/venv/lib/python3.11/site-packages/starlette/responses.py", line 266, in __call__
        async with anyio.create_task_group() as task_group:
      File "/opt/venv/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 662, in __aexit__
        raise exceptions[0]
      File "/opt/venv/lib/python3.11/site-packages/starlette/responses.py", line 269, in wrap
        await func()
      File "/opt/venv/lib/python3.11/site-packages/starlette/responses.py", line 263, in stream_response
        await send({"type": "http.response.body", "body": b"", "more_body": False})
      File "/opt/venv/lib/python3.11/site-packages/starlette/middleware/errors.py", line 159, in _send
        await send(message)
      File "/opt/venv/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 561, in send
        raise RuntimeError("Response content shorter than Content-Length")
    RuntimeError: Response content shorter than Content-Length
    
    Looking through the spec a bit more, it seems like it's okay to not
    provide a content length and I think actually encouraged
    
    https://datatracker.ietf.org/doc/html/rfc7232#section-4.1
    cbanek committed Sep 7, 2023
    Configuration menu
    Copy the full SHA
    d1ab3e9 View commit details
    Browse the repository at this point in the history