#344 Use unique user agent for waiverdb-cli requests
Merged 4 years ago by lholecek. Opened 4 years ago by lholecek.
lholecek/waiverdb waiverdb-cli-user-agent  into  master

file modified
+5 -1
@@ -190,12 +190,16 @@ 

              "comment": "This is fine",

              "username": None

          }]

+         headers = {

+             'Content-Type': 'application/json',

+             'User-Agent': f'waiverdb-cli {__version__}',

+         }

          mock_oidc_req.assert_called_once_with(

              url='http://localhost:5004/api/v1.0/waivers/',

              data=json.dumps(exp_json),

              scopes=['openid'],

              timeout=60,

-             headers={'Content-Type': 'application/json'})

+             headers=headers)

          assert result.exit_code == 0

          assert result.output.startswith('Created waiver 15 for result with id 123\n')

  

file modified
+4 -1
@@ -243,7 +243,10 @@ 

      data = json.dumps(data_list)

      common_request_arguments = {

          'data': data,

-         'headers': {'Content-Type': 'application/json'},

+         'headers': {

+             'Content-Type': 'application/json',

+             'User-Agent': f'waiverdb-cli {__version__}',

+         },

          'timeout': 60,

      }

      if auth_method == 'OIDC':

Build 7f9cbc7e75422e71304a2cccefb68de0bb4620a3 FAILED!
Rebase or make new commits to rebuild.

rebased onto c4650d00679e69b474a0934887204b670a52f23e

4 years ago

rebased onto a798380

4 years ago

Pull-Request has been merged by lholecek

4 years ago