-
Notifications
You must be signed in to change notification settings - Fork 2
release: 3.37.0 #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
release: 3.37.0 #59
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| { | ||
| ".": "3.36.0" | ||
| ".": "3.37.0" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,6 +27,7 @@ | |
| ) | ||
| from ._utils import ( | ||
| is_given, | ||
| is_mapping_t, | ||
| maybe_transform, | ||
| get_async_library, | ||
| async_maybe_transform, | ||
|
|
@@ -114,6 +115,15 @@ def __init__( | |
| if base_url is None: | ||
| base_url = f"https://api.supermemory.ai" | ||
|
|
||
| custom_headers_env = os.environ.get("SUPERMEMORY_CUSTOM_HEADERS") | ||
| if custom_headers_env is not None: | ||
| parsed: dict[str, str] = {} | ||
| for line in custom_headers_env.split("\n"): | ||
| colon = line.find(":") | ||
| if colon >= 0: | ||
| parsed[line[:colon].strip()] = line[colon + 1 :].strip() | ||
| default_headers = {**parsed, **(default_headers if is_mapping_t(default_headers) else {})} | ||
|
Comment on lines
+118
to
+125
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [High] Env-supplied headers can silently override the SDK's
Consider stripping or blocking reserved headers ( |
||
|
|
||
| super().__init__( | ||
| version=__version__, | ||
| base_url=base_url, | ||
|
|
@@ -440,6 +450,15 @@ def __init__( | |
| if base_url is None: | ||
| base_url = f"https://api.supermemory.ai" | ||
|
|
||
| custom_headers_env = os.environ.get("SUPERMEMORY_CUSTOM_HEADERS") | ||
| if custom_headers_env is not None: | ||
| parsed: dict[str, str] = {} | ||
| for line in custom_headers_env.split("\n"): | ||
| colon = line.find(":") | ||
| if colon >= 0: | ||
| parsed[line[:colon].strip()] = line[colon + 1 :].strip() | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Medium] Same empty header name issue in Identical to the sync client: malformed lines (e.g. |
||
| default_headers = {**parsed, **(default_headers if is_mapping_t(default_headers) else {})} | ||
|
Comment on lines
+453
to
+460
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [High] Same Identical logic in |
||
|
|
||
| super().__init__( | ||
| version=__version__, | ||
| base_url=base_url, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. | ||
|
|
||
| __title__ = "supermemory" | ||
| __version__ = "3.36.0" # x-release-please-version | ||
| __version__ = "3.37.0" # x-release-please-version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Medium] Malformed header lines produce empty header names instead of failing fast
A line like
': bad'passes thecolon >= 0check and inserts""(empty string) as a header name. This doesn't raise at construction time — it propagates into the request and causes a generic runtime error later, making the root cause hard to diagnose.Add a guard to skip (or raise) when the header name is empty after stripping: