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
2 changes: 1 addition & 1 deletion .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
pip install -r test-requirements.txt -r requirements.txt
- name: Run tests
run: |
mypy --check tinify
mypy tinify

Integration_tests:
if: github.event_name == 'push'
Expand Down
5 changes: 3 additions & 2 deletions tinify/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import os
import platform
import requests
from requests.structures import CaseInsensitiveDict
import requests.exceptions
from requests.compat import json # type: ignore
import traceback
Expand All @@ -31,9 +32,9 @@ def __init__(self, key, app_identifier=None, proxy=None): # type: (str, Optiona
if proxy:
self.session.proxies = {'https': proxy}
self.session.auth = ('api', key)
self.session.headers = {
self.session.headers = CaseInsensitiveDict({
'user-agent': self.USER_AGENT + ' ' + app_identifier if app_identifier else self.USER_AGENT,
}
})
self.session.verify = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'data', 'cacert.pem')

def __enter__(self): # type: () -> Client
Expand Down
Loading