Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for working with ServerlessFramework #503

Merged
merged 3 commits into from
Oct 2, 2018

Conversation

wscholar
Copy link
Contributor

@wscholar wscholar commented Oct 1, 2018

Authorization was coming in empty because it was checking caps vs lowercase.

Authorization was coming in empty because it was checking caps vs lowercase.
@cleemullins
Copy link
Contributor

@benbrown Can you take a look? How are non-standard cased parameters normally handled in JS

@cleemullins
Copy link
Contributor

@benbrown @Stevenic The build is failing with this:

1) BotFrameworkAdapter
       should processActivity().:
     Error: Timeout of 5000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/travis/build/Microsoft/botbuilder-js/libraries/botbuilder/tests/botFrameworkAdapter.test.js)
  
  2) BotFrameworkAdapter
       should processActivity() sent as body.:
     Error: Timeout of 5000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/travis/build/Microsoft/botbuilder-js/libraries/botbuilder/tests/botFrameworkAdapter.test.js)
  
  3) BotFrameworkAdapter
       should return 500 error on bot logic exception during processActivity().:
     Error: Timeout of 5000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/travis/build/Microsoft/botbuilder-js/libraries/botbuilder/tests/botFrameworkAdapter.test.js)
  
  4) BotFrameworkAdapter
       should return bots 'invokeResponse'.:
     Error: Timeout of 5000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/travis/build/Microsoft/botbuilder-js/libraries/botbuilder/tests/botFrameworkAdapter.test.js)
  
  5) BotFrameworkAdapter
       should return 500 error if bot fails to return an 'invokeResponse'.:
     Error: Timeout of 5000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/travis/build/Microsoft/botbuilder-js/libraries/botbuilder/tests/botFrameworkAdapter.test.js)
  

@benbrown
Copy link
Contributor

benbrown commented Oct 1, 2018

This is a reasonable approach to the problem, but I'm not sure why it broke the build. I'll check that out.

@benbrown benbrown self-assigned this Oct 1, 2018
@wscholar
Copy link
Contributor Author

wscholar commented Oct 1, 2018 via email

@benbrown
Copy link
Contributor

benbrown commented Oct 2, 2018

@wscholar - the tests are failing because, in the absence of either header, your code leaves the variable null, whereas the tests expect at least an empty string.

Can you change your implementation to:
const authHeader: string = req.headers.authorization || req.headers.Authorization || '';

This should have the same impact.

Copy link
Contributor

@benbrown benbrown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this:

const authHeader: string = req.headers.authorization || req.headers.Authorization || '';

@coveralls
Copy link

Pull Request Test Coverage Report for Build 1701

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.07%) to 70.461%

Totals Coverage Status
Change from base Build 1690: 0.07%
Covered Lines: 2206
Relevant Lines: 3003

💛 - Coveralls

@benbrown
Copy link
Contributor

benbrown commented Oct 2, 2018

Thanks for the contribution, @wscholar

@benbrown benbrown merged commit 49eed5d into microsoft:master Oct 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants