Move accept header to client instead of proxy

Signed-off-by: Julio Zynger <julio.zynger@soundcloud.com>
This commit is contained in:
Julio Zynger
2022-01-03 15:15:24 +01:00
parent 108a0cf2fb
commit 0781c324d5
3 changed files with 7 additions and 4 deletions
+1 -2
View File
@@ -110,10 +110,9 @@ proxy:
'/gocd':
target: https://your.gocd.instance.com/go/api
allowedMethods: ['GET']
allowedHeaders: ['Authorization', 'Accept']
allowedHeaders: ['Authorization']
headers:
Authorization: Basic ${GOCD_AUTH_TOKEN}
Accept: application/vnd.go.cd+json
organization:
name: My Company
+1 -2
View File
@@ -41,10 +41,9 @@ proxy:
'/gocd':
target: '<go cd server host>/go/api'
allowedMethods: ['GET']
allowedHeaders: ['Authorization', 'Accept']
allowedHeaders: ['Authorization']
headers:
Authorization: Basic ${GOCD_AUTH_TOKEN}
Accept: application/vnd.go.cd+json
```
You should also include the `gocd` section to allow for the plugin to redirect back to GoCD pipelines in your deployed instance:
+5
View File
@@ -26,6 +26,11 @@ export class GoCdClientApi implements GoCdApi {
const baseUrl = await this.discoveryApi.getBaseUrl('proxy');
const pipelineHistoryResponse = await fetch(
`${baseUrl}/gocd/pipelines/${pipelineName}/history`,
{
headers: {
Accept: 'application/vnd.go.cd+json',
},
},
);
return await pipelineHistoryResponse.json();