Helpers for modifying request headers as middleware#710
Closed
bitemyapp wants to merge 3 commits into
Closed
Conversation
snoyberg
requested changes
Aug 21, 2018
|
|
||
| -- | apply a function that modifies a request as a 'Middleware' | ||
| modifyRequest :: (Request -> Request) -> Middleware | ||
| modifyRequest f app req respond = app (f req) $ respond |
Member
There was a problem hiding this comment.
You can eta reduce and remove the respond.
| type Middleware = Application -> Application | ||
|
|
||
|
|
||
| -- | apply a function that modifies a request as a 'Middleware' |
Member
There was a problem hiding this comment.
Can you add a @since comment here?
| bss <- loop | ||
| return $ LI.Chunk bs bss | ||
|
|
||
| -- | Apply the provided function to the request header list of the Request. |
Member
There was a problem hiding this comment.
Perhaps add a comment about this being intended to work with modifyRequest?
Contributor
|
Added to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before submitting your PR, check that you've:
Yep, minor bump because it's a backwards compatible addition.
@sincedeclarations to the HaddockAfter submitting your PR: