Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
gi0baro committed Jan 28, 2024
2 parents 887f3f2 + 6a409a1 commit 7ab647e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
5 changes: 2 additions & 3 deletions emmett/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
:license: BSD-3-Clause
"""

if __name__ == "__main__":
from .cli import main
from emmett.cli import main

main(as_module=True)
main(as_module=True)
2 changes: 1 addition & 1 deletion emmett/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.5.8"
__version__ = "2.5.9"
2 changes: 1 addition & 1 deletion emmett/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ async def asgi(self, scope, send):
return
self._headers.update(self._get_stat_headers(stat_data))
await self._send_headers(send)
if 'http.response.pathsend' in scope['extensions']:
if 'http.response.pathsend' in scope.get('extensions', {}):
await send({
'type': 'http.response.pathsend',
'path': str(self.file_path)
Expand Down
6 changes: 6 additions & 0 deletions emmett/rsgi/wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ def __init__(
def headers(self):
return self._scope.headers

@cachedprop
def host(self) -> str:
if self._scope.http_version[0] == '1':
return self.headers.get('host')
return self._scope.authority

@cachedprop
def query_params(self) -> sdict[str, Union[str, List[str]]]:
rv: sdict[str, Any] = sdict()
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "emmett"

[tool.poetry]
name = "emmett"
version = "2.5.8"
version = "2.5.9"
description = "The web framework for inventors"
authors = ["Giovanni Barillari <[email protected]>"]
license = "BSD-3-Clause"
Expand Down Expand Up @@ -47,7 +47,7 @@ emmett = "emmett.cli:main"
[tool.poetry.dependencies]
python = "^3.8"
click = ">=6.0"
granian = "~1.0.0"
granian = "~1.0.2"
emmett-crypto = "^0.5"
pendulum = "~3.0.0"
pyDAL = "17.3"
Expand Down

0 comments on commit 7ab647e

Please sign in to comment.