Skip to content

Commit

Permalink
add environent to actions
Browse files Browse the repository at this point in the history
  • Loading branch information
realgam3 committed Jan 1, 2024
1 parent 5ebcb8a commit d5d6c7e
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 80 deletions.
1 change: 1 addition & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ permissions:
jobs:
pypi-publish:
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
if: github.ref_type == 'tag'
Expand Down
2 changes: 1 addition & 1 deletion examples/request_http_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import requests_raw

res = requests_raw.raw(
url='https://httpbin.org/',
url='http://httpbin.org/',
data=b"GET /get HTTP/1.1\r\nHost: httpbin.org\r\n\r\n",
proxies={
"http": "http://127.0.0.1:8080",
Expand Down
2 changes: 1 addition & 1 deletion requests_raw/__version__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__title__ = 'requests-raw'
__description__ = 'Use requests to talk HTTP via a Raw sockets (To Test RFC Compliance)'
__description__ = 'HTTP communication through raw sockets using requests for RFC compliance testing'
__url__ = 'https://github.com/realgam3/requests-raw'
__version__ = '2.0.0'
__build__ = 0x020000
Expand Down
13 changes: 4 additions & 9 deletions requests_raw/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,11 @@ def request(
enforce_content_length: bool = True,
) -> None:
self.__method = method.lower()
if self.__method == __title__:
# HTTP Proxy
# HTTP Proxy
if self.__method == __title__ and not url.startswith("/"):
_url = parse_url(url)
if _url.scheme and _url.netloc:
_body = body.split(b"/", 1)
if _body[0].endswith(b" "):
_body.insert(1, "{url.scheme}://{url.netloc}/".format(url=_url).encode())
else:
_body.insert(1, b"/")
body = b"".join(_body)
_body = body.split(b"/", 1)
body = b"".join([_body[0], f"{_url.scheme}://{_url.netloc}/".encode(), _body[1]])

return super().request(
method, url, body, headers,
Expand Down
6 changes: 0 additions & 6 deletions setup.cfg

This file was deleted.

63 changes: 0 additions & 63 deletions setup.py

This file was deleted.

0 comments on commit d5d6c7e

Please sign in to comment.