Skip to content

Commit 0dd80c4

Browse files
Re-add the user-agents - got lost in a bad merge
1 parent dec1909 commit 0dd80c4

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

lib/agents.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ function getAuthorisedAgents(server, auth, callback) {
1010
path: '/app/rest/agents?locator=authorized:true',
1111
headers: {
1212
'accept': 'application/json',
13-
"Authorization" : auth
13+
"Authorization" : auth,
14+
'user-agent': 'TeamCityCloudAgentUpdater/1.0'
1415
},
1516
agent: false
1617
}, function(response) {
@@ -31,7 +32,8 @@ function getAgentDetails(server, auth, href, callback) {
3132
path: href,
3233
headers: {
3334
'accept': 'application/json',
34-
"Authorization" : auth
35+
"Authorization" : auth,
36+
'user-agent': 'TeamCityCloudAgentUpdater/1.0'
3537
},
3638
agent: false
3739
}, function(response) {
@@ -63,7 +65,8 @@ function disableAgent(server, auth, agent, oldImage, newImage, dryrun) {
6365
headers: {
6466
'content-type': 'application/xml',
6567
'Authorization' : auth,
66-
'Origin': server
68+
'Origin': server,
69+
'user-agent': 'TeamCityCloudAgentUpdater/1.0'
6770
},
6871
agent: false
6972
}, function(response) {
@@ -157,7 +160,8 @@ function removeAgent(server, auth, agent, dryrun) {
157160
headers: {
158161
'content-type': 'application/xml',
159162
'Authorization' : auth,
160-
'Origin': server
163+
'Origin': server,
164+
'user-agent': 'TeamCityCloudAgentUpdater/1.0'
161165
},
162166
agent: false
163167
}, function(response) {
@@ -241,4 +245,4 @@ module.exports = {
241245
removeAgent,
242246
removeAgentIfSuperseded,
243247
removeDisabledAgents
244-
};
248+
};

lib/cloud-profiles.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ function getRootProjectFeatures(server, auth, callback) {
1111
path: '/app/rest/projects/id:_Root/projectFeatures',
1212
headers: {
1313
'accept': 'application/json',
14-
"Authorization" : auth
14+
"Authorization" : auth,
15+
'user-agent': 'TeamCityCloudAgentUpdater/1.0'
1516
}
1617
}, function(response) {
1718
if (('' + response.statusCode).match(/^2\d\d$/)) {
@@ -88,7 +89,8 @@ function updateCloudImageOnTeamCity(server, auth, cloudProfile, cloudImage, curr
8889
headers: {
8990
'Authorization': auth,
9091
'Content-type': 'text/plain',
91-
'Origin': server
92+
'Origin': server,
93+
'user-agent': 'TeamCityCloudAgentUpdater/1.0'
9294
}
9395
}, function(response) {
9496
if (('' + response.statusCode).match(/^2\d\d$/)) {
@@ -160,4 +162,4 @@ module.exports = {
160162
updateCloudImageOnTeamCity,
161163
tweakImageName,
162164
updateCloudImage
163-
};
165+
};

0 commit comments

Comments
 (0)