Skip to content

BlackSheep does't work with a2wsgi #193

@jordemort

Description

@jordemort

I attempted to use BlackSheep with https://github.com/abersheeran/a2wsgi so that I could use BlackSheep with https://pywebview.flowrl.com/ which expects a WSGI application.

It doesn't work because it seems that BlackSheep does not fully conform to the ASGI specification. Specifically, the raw_path field in an ASGI connection scope is optional, but BlackSheep treats it as required. a2wsgi does not provide this field, so when running a BlackSheep app under its ASGIMiddleware, a KeyError is thrown at https://github.com/Neoteroi/BlackSheep/blob/main/blacksheep/server/application.py#L632

I thought this would be easy to fix myself, and started to attempt to, but then I ran across this block of code: https://github.com/Neoteroi/BlackSheep/blob/main/blacksheep/server/application.py#L682-L689 - it looks like MountMixin depends on raw_path being present, and I'm not sure if it would be correct to rewrite it to use path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions