Skip to content

Commit

Permalink
Merge pull request #29 from devolo/fix_api
Browse files Browse the repository at this point in the history
Fix HstsPreloadData not always providing sourceTime
  • Loading branch information
2Fake authored Dec 9, 2022
2 parents 474ec66 + c413a7a commit 246b948
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v1.0.2] - 2022/12/09

### Fixed

- The API does not provide the sourceTime data in every case

## [v1.0.1] - 2021/03/23

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion ssllabs/api/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async def _call(self, api_endpoint: str, **kwargs) -> httpx.Response:
r = await self._client.get(f"{SSLLABS_URL}{api_endpoint}", params=kwargs)
else:
async with httpx.AsyncClient() as client:
r = await client.get(f"{SSLLABS_URL}{api_endpoint}", params=kwargs)
r = await client.get(f"{SSLLABS_URL}{api_endpoint}", params=kwargs, timeout=30.0)
r.raise_for_status()
return r

Expand Down
2 changes: 1 addition & 1 deletion ssllabs/data/hsts_preload.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ class HstsPreloadData:
error: Optional[str]
"""Error message, when status is 'error'"""

sourceTime: int
sourceTime: Optional[int]
"""Time, as a Unix timestamp, when the preload database was retrieved"""

0 comments on commit 246b948

Please sign in to comment.