diff --git a/app-config.yaml b/app-config.yaml index 3eb6311463..359aecf4d2 100644 --- a/app-config.yaml +++ b/app-config.yaml @@ -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 diff --git a/plugins/gocd/README.md b/plugins/gocd/README.md index 96329e7e13..d17b625581 100644 --- a/plugins/gocd/README.md +++ b/plugins/gocd/README.md @@ -41,10 +41,9 @@ proxy: '/gocd': target: '/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: diff --git a/plugins/gocd/src/api/gocdApi.client.ts b/plugins/gocd/src/api/gocdApi.client.ts index 3907281ff4..d74cf9e055 100644 --- a/plugins/gocd/src/api/gocdApi.client.ts +++ b/plugins/gocd/src/api/gocdApi.client.ts @@ -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();