-
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
Changes from 1 commit
712e8bb
2c1a6c6
eb220c9
a59ee6b
fc7884f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,6 +118,7 @@ module Yesod.Core.Handler | |
, setHeader | ||
, replaceOrAddHeader | ||
, setLanguage | ||
, addContentDispositionFileName | ||
-- ** Content caching and expiration | ||
, cacheSeconds | ||
, neverExpires | ||
|
@@ -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 commentThe 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" |
||
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 commentThe 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? |
||
|
||
-- | Set an arbitrary response header. | ||
-- | ||
-- Note that, while the data type used here is 'Text', you must provide only | ||
|
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.