httpbinx 1.5.2__py3-none-any.whl → 1.6.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
httpbinx/VERSION CHANGED
@@ -1 +1 @@
1
- 1.5.2
1
+ 1.6.0
@@ -12,7 +12,7 @@ router = APIRouter(tags=['Status codes'])
12
12
 
13
13
  @router.api_route(
14
14
  '/status/{codes}',
15
- methods=['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'TRACE'],
15
+ methods=['GET'],
16
16
  summary='Return status code or random status code '
17
17
  'if more than one are given',
18
18
  response_description='Response corresponding to different HTTP status codes.'
httpbinx/schemas.py CHANGED
@@ -1,14 +1,10 @@
1
1
  # -*- coding: utf-8 -*-
2
+ import json
2
3
  from enum import Enum
3
4
  from functools import lru_cache
4
- import json
5
- from typing import AnyStr
6
- from typing import Dict
7
- from typing import Union
5
+ from typing import AnyStr, Dict, Union
8
6
 
9
- from pydantic import AnyHttpUrl
10
- from pydantic import BaseModel
11
- from pydantic import Field
7
+ from pydantic import AnyHttpUrl, BaseModel, Field
12
8
  from starlette.requests import Request
13
9
 
14
10
 
@@ -103,7 +99,10 @@ class RequestAttrs:
103
99
  @property
104
100
  def client_host(self) -> str:
105
101
  """request client host."""
106
- return self.request.client.host
102
+ client = self.request.client
103
+ if client is None:
104
+ return ''
105
+ return client.host
107
106
 
108
107
  @property
109
108
  async def data(self):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: httpbinx
3
- Version: 1.5.2
3
+ Version: 1.6.0
4
4
  Summary: HTTP Request & Response Service, written in Python + FastAPI.
5
5
  Home-page: https://github.com/imleowoo/httpbinx
6
6
  Author: Leo
@@ -12,12 +12,12 @@ Project-URL: Source, https://github.com/imleowoo/httpbinx
12
12
  Classifier: Programming Language :: Python
13
13
  Classifier: Programming Language :: Python :: 3 :: Only
14
14
  Classifier: Programming Language :: Python :: 3
15
- Classifier: Programming Language :: Python :: 3.7
16
15
  Classifier: Programming Language :: Python :: 3.8
17
16
  Classifier: Programming Language :: Python :: 3.9
18
17
  Classifier: Programming Language :: Python :: 3.10
19
18
  Classifier: Programming Language :: Python :: 3.11
20
- Requires-Python: >=3.7
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Requires-Python: >=3.8
21
21
  Description-Content-Type: text/markdown
22
22
  License-File: LICENSE
23
23
  Requires-Dist: fastapi
@@ -1,10 +1,10 @@
1
- httpbinx/VERSION,sha256=3tG2AegdMcofZcTzzPLr15krY5Dje8Kobzg3KC8eAM8,6
1
+ httpbinx/VERSION,sha256=yx2aMLxKuKOX85t9eGu4KsoLgWB37vw118giAX119qU,6
2
2
  httpbinx/__init__.py,sha256=hPPEFgOAqXD22JamTP9uGK42qngDmwmM35RVg2varDA,289
3
3
  httpbinx/constants.py,sha256=aJay1yI313fLxfFXgBPLE6p_UABlHq1KGEcdO7Nf2FQ,906
4
4
  httpbinx/helpers.py,sha256=-fJyFbToQ0QwRY5UZ3Bkx7Ui_nj_bk8Wd4qKRtYGIsg,3787
5
5
  httpbinx/main.py,sha256=idQXiobak79bY1Stm2G2aAAQO6LmrAB5dZbflJ8u5ew,837
6
6
  httpbinx/meta.py,sha256=gqWHplgb0SiUFVmZ8-gbOrZA468R-y9uDCQjqeQSHN8,1185
7
- httpbinx/schemas.py,sha256=8RAV3xZkVOPgvWL5veyBOT5JSvS404lTdeN_Wu5phIs,4032
7
+ httpbinx/schemas.py,sha256=QxBcsd4Go1azLPWF8E_uLyUVcnzI7Rwny-woDPvAzp0,4029
8
8
  httpbinx/utils.py,sha256=kMVB5ORarUJj6MdySbb8utCbgyM2WbitSmiDYBAFnSs,464
9
9
  httpbinx/examples/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  httpbinx/routers/__init__.py,sha256=xwbZGA3-sV07HCPAly8o5uUJGbdKH3pBHUakXEjvRK4,1409
@@ -16,7 +16,7 @@ httpbinx/routers/httpmethods.py,sha256=X9YPADi9D6FQnybJWyXc5BTDErgFZ5Xa4OIy7OKAi
16
16
  httpbinx/routers/images.py,sha256=JBZ08Ez2gmXiGfA-jNXN3SaQzvQMmFkRrX9E0f_k3fk,2261
17
17
  httpbinx/routers/redirects.py,sha256=aEWL1VcEaqzAz-nr7fPgKw1_iA_JCtbzS6syB0Urs4E,3023
18
18
  httpbinx/routers/responseformats.py,sha256=sqRLzSFjUmN5B9urbMVR7X_AydqvuT1pvHGIXyzhedw,4996
19
- httpbinx/routers/statuscodes.py,sha256=3vCh_QlNWc9ilkTMnfTPlkKDQubMeM-VQo2Eb0nICNY,1783
19
+ httpbinx/routers/statuscodes.py,sha256=Iu0dcGsXLv34otIrH6WrWm_vOHt-9zAnblojM-d_qV0,1740
20
20
  httpbinx/routers/inspection/__init__.py,sha256=OMPci9p6uK9L6uFKQKbIqOn-r5MndCWSqlw-bJsUE3E,166
21
21
  httpbinx/routers/inspection/request.py,sha256=8b5HEuX2ED-YjMB5S0h-2xZDAmyo4ru9RX2S1tCwaqs,1224
22
22
  httpbinx/routers/inspection/response.py,sha256=yJ46k1O80WO8hq4gF09KHrsQJeP7Cn0aj6AAphfyyAY,2863
@@ -32,8 +32,8 @@ httpbinx/templates/index.html,sha256=9--gnqsRkQjSqiZr-Ljn2gr_b3Ddr8Zx91lFk7o91Vw
32
32
  httpbinx/templates/moby.html,sha256=4lCnl11TgB7Yw1JxeAoVodo2qKU4MyfLcG3qJSs0DUg,3742
33
33
  httpbinx/templates/sample.xml,sha256=UcHibo5ClF0e3nhCbgLlQmUw33Rwnd5Rr6IYIqNQumg,522
34
34
  httpbinx/templates/trackingscripts.html,sha256=M5P33NOYlYaoOEDPzaJqKWPJCPxSx2zZsYWR9DT_D5E,583
35
- httpbinx-1.5.2.dist-info/LICENSE,sha256=t6oZPzEcm1CsBu9sB_8JYTc5rSOUhyQUee5qvAg4o-A,1060
36
- httpbinx-1.5.2.dist-info/METADATA,sha256=i5B2wfXJVRdYRkm4GTynA9qmajuW0UI40Ncl92s6PhI,2309
37
- httpbinx-1.5.2.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
38
- httpbinx-1.5.2.dist-info/top_level.txt,sha256=zg7vMSUefYOTEUftRjOOmG3W5kfueHlHWG7zr46q1jI,9
39
- httpbinx-1.5.2.dist-info/RECORD,,
35
+ httpbinx-1.6.0.dist-info/LICENSE,sha256=t6oZPzEcm1CsBu9sB_8JYTc5rSOUhyQUee5qvAg4o-A,1060
36
+ httpbinx-1.6.0.dist-info/METADATA,sha256=ULkdGc20-rFItJKayo4H-PvntGEqZJS4NngOcEz2cfk,2310
37
+ httpbinx-1.6.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
38
+ httpbinx-1.6.0.dist-info/top_level.txt,sha256=zg7vMSUefYOTEUftRjOOmG3W5kfueHlHWG7zr46q1jI,9
39
+ httpbinx-1.6.0.dist-info/RECORD,,