Move accept header to client instead of proxy
Signed-off-by: Julio Zynger <julio.zynger@soundcloud.com>
This commit is contained in:
+1
-2
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user