Skip to content

Commit

Permalink
[QnA Maker] opim auth header for V5 support (#2001)
Browse files Browse the repository at this point in the history
* host name as-is

* opim auth header for service model v5 support

* Revert "opim auth header for service model v5 support"

This reverts commit b3035fa.

* opim header for v5 authorization
  • Loading branch information
vipeketi authored Apr 9, 2020
1 parent 39d3592 commit 4dd290c
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,9 @@ export class HttpRequestUtils {
*/
private getHeaders(endpoint: QnAMakerEndpoint): any {
const headers: any = {};
const isLegacyProtocol: boolean = endpoint.host.endsWith('v2.0') || endpoint.host.endsWith('v3.0');

if (isLegacyProtocol) {
headers['Ocp-Apim-Subscription-Key'] = endpoint.endpointKey;
} else {
headers.Authorization = `EndpointKey ${ endpoint.endpointKey }`;
}

headers['Ocp-Apim-Subscription-Key'] = endpoint.endpointKey;
headers.Authorization = `EndpointKey ${ endpoint.endpointKey }`;
headers['User-Agent'] = this.getUserAgent();
headers['Content-Type'] = 'application/json';

Expand Down

0 comments on commit 4dd290c

Please sign in to comment.