diff --git a/src/geoserverx/_async/gsx.py b/src/geoserverx/_async/gsx.py index 0afca8e..9f43ee6 100644 --- a/src/geoserverx/_async/gsx.py +++ b/src/geoserverx/_async/gsx.py @@ -1,5 +1,5 @@ -from dataclasses import dataclass -from typing import Optional, Union +from dataclasses import dataclass, field +from typing import Dict, Optional, Union import httpx @@ -51,11 +51,14 @@ class AsyncGeoServerX: password (str): GeoServer password. """ - default_headers = {"Content-Type": "application/json"} username: str = "admin" password: str = "geoserver" url: str = "http://127.0.0.1:8080/geoserver/rest/" - headers: dict = default_headers + headers: Dict[str, str] = field( + default_factory=lambda: { + "Content-Type": "application/json", + } + ) def __post_init__(self): if not self.username and not self.password and not self.url: diff --git a/src/geoserverx/_sync/gsx.py b/src/geoserverx/_sync/gsx.py index 9b67296..15a71e0 100644 --- a/src/geoserverx/_sync/gsx.py +++ b/src/geoserverx/_sync/gsx.py @@ -1,6 +1,6 @@ -from dataclasses import dataclass +from dataclasses import dataclass, field from enum import Enum -from typing import Optional, Union +from typing import Dict, Optional, Union import httpx from pydantic import ValidationError @@ -62,11 +62,14 @@ class SyncGeoServerX: password (str): GeoServer password. """ - default_headers = {"Content-Type": "application/json"} username: str = "admin" password: str = "geoserver" url: str = "http://127.0.0.1:8080/geoserver/rest/" - headers: dict = default_headers + headers: Dict[str, str] = field( + default_factory=lambda: { + "Content-Type": "application/json", + } + ) def __post_init__(self): if not self.username and not self.password and not self.url: