Skip to content

Commit

Permalink
Client versioning in API
Browse files Browse the repository at this point in the history
* Properly declares the client versioning when contacting the Proton
  API.

* Improves kwalitee.

Signed-off-by: Samuele Kaplun <[email protected]>
  • Loading branch information
kaplun committed Dec 4, 2020
1 parent 81dfeec commit 089af8d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Table of Contents

- [v2.2.6](#v226)
- [v2.2.5](#v225)
- [v2.2.4](#v224)
- [v2.2.3](#v223)
Expand All @@ -14,6 +15,10 @@
- [v2.0.0](#v200)
- [v0.1.0](#v010)

## v2.2.6

- Enhancement: Properly specifies versioning when contacting Proton API

## v2.2.5

- Enhancement: Introduces support for the client to declare itself
Expand Down
2 changes: 1 addition & 1 deletion protonvpn_cli/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
)
# Constants
from .constants import (
CONFIG_DIR, OVPN_FILE, PASSFILE, CONFIG_FILE, CLIENT_SUFFIX
CONFIG_DIR, OVPN_FILE, PASSFILE, CONFIG_FILE
)


Expand Down
4 changes: 2 additions & 2 deletions protonvpn_cli/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
SPLIT_TUNNEL_FILE = os.path.join(CONFIG_DIR, "split_tunnel.txt")
OVPN_FILE = os.path.join(CONFIG_DIR, "connect.ovpn")
PASSFILE = os.path.join(CONFIG_DIR, "pvpnpass")
CLIENT_SUFFIX = "plc" # ProtonVPN Linux Community
VERSION = "2.2.5"
CLIENT_SUFFIX = "plc" # ProtonVPN Linux Community
VERSION = "2.2.6"
2 changes: 1 addition & 1 deletion protonvpn_cli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def call_api(endpoint, json_format=True, handle_errors=True):
url = api_domain + endpoint

headers = {
"x-pm-appversion": "Other",
"x-pm-appversion": "LinuxVPN_{0}".format(VERSION),
"x-pm-apiversion": "3",
"Accept": "application/vnd.protonmail.v1+json"
}
Expand Down

0 comments on commit 089af8d

Please sign in to comment.