Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release

on:
workflow_dispatch:
inputs:
bump_type:
description: 'Version bump type'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
- major

jobs:
tag:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Bump version and push tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
default_bump: ${{ github.event.inputs.bump_type }}

- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Release History
================

1.2.4 (2026-01-25)
------------------
**Bugfixes:**

- **Custom Configuration Support**: Fixed an issue where custom request parameters (e.g., `headerOrder`, `ja3String`, `h2Settings`) were silently ignored by `build_request` logic. This ensures advanced TLS fingerprinting options are correctly passed to the backend.

1.2.3 (2026-01-24)
------------------
**Improvements:**
Expand Down
26 changes: 24 additions & 2 deletions src/tls_requests/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,9 @@ def build_request(
) -> Request:
"""Build Request instance"""

# Remove keys in kwargs that conflict with explicit args
safe_kwargs = self._rebuild_request_kwargs(**kwargs)

return Request(
method,
url,
Expand All @@ -352,7 +355,7 @@ def build_request(
protocol_racing=protocol_racing if protocol_racing is not None else self.protocol_racing,
allow_http=allow_http if allow_http is not None else self.allow_http,
stream_id=stream_id if stream_id is not None else self.stream_id,
**kwargs,
**safe_kwargs,
)

def build_hook_request(self, request: Request, *args, **kwargs) -> Union[Request, Any]:
Expand All @@ -371,6 +374,24 @@ def build_hook_response(self, response: Response, *args, **kwargs) -> Union[Resp
return hook(response)
return None

def _rebuild_request_kwargs(self, **kwargs) -> dict[str, Any]:
explicit_keys = {
"method",
"url",
"data",
"files",
"json",
"params",
"headers",
"cookies",
"proxy",
"timeout",
"protocol_racing",
"allow_http",
"stream_id",
}
return {k: v for k, v in kwargs.items() if k not in explicit_keys}

def _rebuild_hooks(self, hooks: HookTypes):
if isinstance(hooks, dict):
return {
Expand Down Expand Up @@ -909,6 +930,7 @@ async def abuild_request(
stream_id: Optional[int] = None,
**kwargs,
) -> Request:
safe_kwargs = self._rebuild_request_kwargs(**kwargs)
headers = await self.aprepare_headers(headers)
proxy = await self.aprepare_proxy(self.proxy)
return Request(
Expand All @@ -925,7 +947,7 @@ async def abuild_request(
protocol_racing=protocol_racing if protocol_racing is not None else self.protocol_racing,
allow_http=allow_http if allow_http is not None else self.allow_http,
stream_id=stream_id if stream_id is not None else self.stream_id,
**kwargs,
**safe_kwargs,
)

async def request(
Expand Down