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

HTTPS support #13

Closed
AIGeneratedUsername opened this issue Jul 23, 2021 · 1 comment
Closed

HTTPS support #13

AIGeneratedUsername opened this issue Jul 23, 2021 · 1 comment
Labels
question Further information is requested

Comments

@AIGeneratedUsername
Copy link

  1. Why it does not support HTTPS?
  2. How to make it working with HTTPS?
class MessagePackMiddleware:
    def __init__(self, app: ASGIApp) -> None:
        self.app = app

    async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
        if scope["type"] == "http":
            responder = _MessagePackResponder(self.app)
            await responder(scope, receive, send)
            return
        await self.app(scope, receive, send)
@AIGeneratedUsername AIGeneratedUsername changed the title How to support HTTPS? HTTPS support Jul 23, 2021
@florimondmanca
Copy link
Owner

florimondmanca commented Jul 23, 2021

Hi @AIGeneratedUsername,

Does it not? 😄 The scope["type"] == "http" is an ASGI detail — that code path is followed for HTTP(S) requests, as opposed to WebSocket requests. HTTPS requests should be supported, since HTTPS data is decoded by the server and sent to ASGI apps transparently when they call receive().

Closing since I think this is a misunderstanding, but if there's really something wrong, could you provide a minimal working reproduction case? Thanks.

@florimondmanca florimondmanca added the question Further information is requested label Jul 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants