Skip to content

Commit 36c4100

Browse files
committed
fix: Restore correct Azure Service Bus and data URI formats
- Azure Service Bus connection strings must not have spaces after semicolons - Data URI format must follow RFC 2397 without spaces (data:mimetype;base64,data) - yapf formatting was breaking these protocol requirements - Restored working versions from cd7d886 before yapf formatting broke them Fixes test-live failures caused by malformed connection strings
1 parent 897ecd3 commit 36c4100

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

opwen_email_server/integration/cli.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ def delete_queues(suffix):
5555
return
5656

5757
# https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/servicebus/azure-servicebus/migration_guide.md#working-with-administration-client
58-
connection_string = (f"Endpoint=sb://{config.QUEUE_BROKER_HOST}.servicebus.windows.net/; "
59-
f"SharedAccessKeyName={config.QUEUE_BROKER_USERNAME}; "
60-
f"SharedAccessKey={config.QUEUE_BROKER_PASSWORD}")
58+
connection_string = f"Endpoint=sb://{config.QUEUE_BROKER_HOST}.servicebus.windows.net/;" \
59+
f"SharedAccessKeyName={config.QUEUE_BROKER_USERNAME};" \
60+
f"SharedAccessKey={config.QUEUE_BROKER_PASSWORD}"
6161

6262
with ServiceBusAdministrationClient.from_connection_string(connection_string) as servicebus_mgmt_client:
6363
for queue in servicebus_mgmt_client.list_queues():

opwen_email_server/utils/email_parser.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,7 @@ def _fetch_image_to_base64(image_url: str) -> Optional[str]:
186186

187187
small_image_bytes = _change_image_size(response.content)
188188
small_image_base64 = to_base64(small_image_bytes)
189-
data_uri = f'data:{image_type}; base64, {small_image_base64}'
190-
return data_uri
189+
return f'data:{image_type};base64,{small_image_base64}'
191190

192191

193192
def _is_valid_url(url: Optional[str]) -> bool:

0 commit comments

Comments
 (0)