-
Notifications
You must be signed in to change notification settings - Fork 366
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
added: addContentDispositionFileName #1504
added: addContentDispositionFileName #1504
Conversation
yesod-core/Yesod/Core/Handler.hs
Outdated
@@ -780,6 +781,14 @@ deleteCookie a = addHeaderInternal . DeleteCookie (encodeUtf8 a) . encodeUtf8 | |||
setLanguage :: MonadHandler m => Text -> m () | |||
setLanguage = setSession langKey | |||
|
|||
-- | Set attachment file name. | |||
-- | |||
-- allow UTF-8 character. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably say something like: "Allows Unicode characters by encoding to UTF-8"
@@ -780,6 +781,14 @@ deleteCookie a = addHeaderInternal . DeleteCookie (encodeUtf8 a) . encodeUtf8 | |||
setLanguage :: MonadHandler m => Text -> m () | |||
setLanguage = setSession langKey | |||
|
|||
-- | Set attachment file name. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a ChangeLog entry, cabal version bump, and a @since
comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thinked that wait other pull request.
However, If I should write before it, I write.
So I write.
yesod-core/Yesod/Core/Handler.hs
Outdated
addContentDispositionFileName :: MonadHandler m => T.Text -> m () | ||
addContentDispositionFileName name | ||
= addHeader "Content-Disposition" $ | ||
"attachment; filename*=UTF-8''" `mappend` decodeUtf8 (H.urlEncode True (encodeUtf8 name)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't seen this syntax before. Can you reference the relevant spec that details how this is supposed to work in a comment?
I wrote battle of multibyte from code review.
d03ff94
to
a59ee6b
Compare
@snoyberg I wrote comment, changelog. |
Thanks! |
Before submitting your PR, check that you've:
@since
declarations to the Haddocks for new, public APIsAfter submitting your PR:
I pushed other pull request, I checkbox after complete other pull request.
This function is setting attchment file name.
Setting is hard that allow UTF-8 multibyte character.
This function running our product.
I want to push upstream.