|
13 | 13 | # limitations under the License. |
14 | 14 |
|
15 | 15 | import uuid |
16 | | -from typing import TYPE_CHECKING, Any, Dict, Optional, Union |
| 16 | +from typing import TYPE_CHECKING, Any, Dict |
17 | 17 |
|
18 | | -from selenium.webdriver.remote.client_config import ClientConfig |
19 | 18 | from selenium.webdriver.remote.remote_connection import RemoteConnection |
20 | 19 |
|
21 | 20 | from appium.common.helper import library_version |
|
30 | 29 |
|
31 | 30 |
|
32 | 31 | class AppiumConnection(RemoteConnection): |
33 | | - RemoteConnection.user_agent = f'{PREFIX_HEADER}{library_version()} ({RemoteConnection.user_agent})' |
| 32 | + """ |
| 33 | + A subclass of selenium.webdriver.remote.remote_connection.Remoteconnection. |
34 | 34 |
|
35 | | - def __init__( |
36 | | - self, |
37 | | - remote_server_addr: str, |
38 | | - keep_alive: Optional[bool] = False, |
39 | | - ignore_proxy: Optional[bool] = False, |
40 | | - init_args_for_pool_manager: Union[Dict[str, Any], None] = None, |
41 | | - client_config: Optional[ClientConfig] = None, |
42 | | - ): |
43 | | - if client_config is None: |
44 | | - client_config = ClientConfig(remote_server_addr=remote_server_addr) |
45 | | - if keep_alive is not None: |
46 | | - client_config.keep_alive = keep_alive |
47 | | - if ignore_proxy is not None: |
48 | | - client_config.ignore_proxy = ignore_proxy |
49 | | - if init_args_for_pool_manager is not None: |
50 | | - client_config.init_args_for_pool_manager = init_args_for_pool_manager |
| 35 | + The changes are: |
| 36 | + - The default user agent |
| 37 | + - Adds 'X-Idempotency-Key' header in a new session request to avoid proceeding |
| 38 | + the same request multiple times in the Appium server side. |
| 39 | + - https://github.com/appium/appium-base-driver/pull/400 |
| 40 | + """ |
51 | 41 |
|
52 | | - super().__init__(client_config=client_config) |
| 42 | + RemoteConnection.user_agent = f'{PREFIX_HEADER}{library_version()} ({RemoteConnection.user_agent})' |
53 | 43 |
|
54 | 44 | @classmethod |
55 | 45 | def get_remote_connection_headers(cls, parsed_url: 'ParseResult', keep_alive: bool = True) -> Dict[str, Any]: |
|
0 commit comments