Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
MatMaul committed Dec 9, 2024
1 parent a3f58ad commit 920a3f1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion synapse/config/experimental.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def _check_enabled(self, attribute: attr.Attribute, value: bool) -> None:
vapid_contact_email: str = ""
vapid_private_key: str = ""
vapid_app_server_key: str = ""
ttl: int = 15 * 60
ttl: int = 12 * 60 * 60


class ExperimentalConfig(Config):
Expand Down
10 changes: 5 additions & 5 deletions synapse/push/webpushpusher.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,20 +300,20 @@ class HttpDelayedRequest:
status_code: int = 200
text: Optional[str] = None

def __init__(self, endpoint: str, data: bytes, vapid_headers: CaseInsensitiveDict):
def __init__(self, endpoint: str, data: bytes, webpush_headers: CaseInsensitiveDict):
self.endpoint = endpoint
self.data = data
self.vapid_headers = vapid_headers
self.webpush_headers = webpush_headers

def execute(
self, http_client: SimpleHttpClient, low_priority: bool, topic: bytes
) -> defer.Deferred[IResponse]:
# Convert the headers to the camelcase version.
headers = {
b"User-Agent": ["sygnal"],
b"Content-Encoding": [self.vapid_headers["content-encoding"]],
b"Authorization": [self.vapid_headers["authorization"]],
b"TTL": [self.vapid_headers["ttl"]],
b"Content-Encoding": [self.webpush_headers["content-encoding"]],
b"Authorization": [self.webpush_headers["authorization"]],
b"TTL": [self.webpush_headers["ttl"]],
b"Urgency": ["low" if low_priority else "normal"],
}
if topic:
Expand Down

0 comments on commit 920a3f1

Please sign in to comment.