Skip to content

feat: Add getters for headers#111

Merged
seb-cr merged 3 commits into
masterfrom
108-add-getters-for-headers
Oct 29, 2020
Merged

feat: Add getters for headers#111
seb-cr merged 3 commits into
masterfrom
108-add-getters-for-headers

Conversation

@seb-cr
Copy link
Copy Markdown
Contributor

@seb-cr seb-cr commented Oct 28, 2020

Adds two new methods to RequestService:

  • getAllHeaders(): shortcut for request.getContainer().getEvent().headers
  • getHeader(name, default=''): get a header value using a case-insensitive search

Some of the existing code can then be significantly improved using getHeader.

@seb-cr seb-cr force-pushed the 108-add-getters-for-headers branch from a9d3d16 to e020a3e Compare October 28, 2020 17:05
@seb-cr seb-cr requested a review from dipasqualew October 28, 2020 17:08
Copy link
Copy Markdown
Contributor

@dipasqualew dipasqualew left a comment

Choose a reason for hiding this comment

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

That's great work, having those shortcuts greatly lowers the complexity of other functions. Thanks! I left a couple of minor notes

Comment thread src/Service/Request.service.js Outdated
Comment thread src/Service/Request.service.js
dipasqualew
dipasqualew previously approved these changes Oct 29, 2020
@seb-cr seb-cr merged commit 29b4e68 into master Oct 29, 2020
@seb-cr seb-cr deleted the 108-add-getters-for-headers branch October 29, 2020 09:36
@lebaz20
Copy link
Copy Markdown
Contributor

lebaz20 commented Oct 29, 2020

🎉 This PR is included in version 1.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants