Skip to content

Commit 02c838c

Browse files
author
joel@joellee.org
committed
fix: add default for optional headers
1 parent a6584a7 commit 02c838c

File tree

4 files changed

+171
-4
lines changed

4 files changed

+171
-4
lines changed

poetry.lock

Lines changed: 167 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "supafunc"
3-
version = "0.2.0"
3+
version = "0.2.1"
44
description = "Library for Supabase Functions"
55
authors = ["Joel Lee <joel@joellee.org>"]
66
license = "MIT"

supafunc/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__version__ = "0.2.0"
1+
__version__ = "0.2.1"
22
from .functions_client import FunctionsClient

supafunc/functions_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ async def invoke(self, function_name: str, invoke_options: Dict) -> Dict:
3535
Dictionary with data and/or error message
3636
"""
3737
try:
38-
headers = {**self.headers, **invoke_options.get('headers')}
38+
headers = {**self.headers, **invoke_options.get('headers', {})}
3939
body = invoke_options.get('body')
4040
response_type = invoke_options.get('responseType')
4141
response = httpx.post(
@@ -49,7 +49,7 @@ async def invoke(self, function_name: str, invoke_options: Dict) -> Dict:
4949
if response_type == 'json':
5050
data = response.json()
5151
else:
52-
data = response.data
52+
data = response.content
5353
return {"data": data, "error": None}
5454
except Exception as e:
5555
return {

0 commit comments

Comments
 (0)