Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

Commit

Permalink
Use consistent header name for authorization header (#1948)
Browse files Browse the repository at this point in the history
* Use consistent header name for authorization header

* Remove dependency on @azure/ms-rest-js
  • Loading branch information
henryjenkins authored and darrenj committed Aug 5, 2019
1 parent b095aa7 commit 1eb8888
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import { SkillHttpBotAdapter } from './skillHttpBotAdapter';
* 2. Call SkillHttpBotAdapter to process the incoming activity.
*/
export class SkillHttpAdapter extends BotFrameworkAdapter {
private readonly authHeaderName: string = 'Authorization';

private readonly botAdapter: IActivityHandler;
private readonly authenticationProvider?: IAuthenticationProvider;
private readonly telemetryClient?: BotTelemetryClient;
Expand All @@ -35,8 +33,7 @@ export class SkillHttpAdapter extends BotFrameworkAdapter {
if (this.authenticationProvider) {
// grab the auth header from the inbound http request
// eslint-disable-next-line @typescript-eslint/tslint/config
const headers: { [header: string]: string | string[] | undefined } = req.headers;
const authHeader: string = <string> headers[this.authHeaderName];
const authHeader: string = req.headers.authorization || req.headers.Authorization || '';
const authenticated: boolean = await this.authenticationProvider.authenticate(authHeader);

if (!authenticated) {
Expand Down

0 comments on commit 1eb8888

Please sign in to comment.