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

added: addContentDispositionFileName #1504

Merged
merged 5 commits into from Apr 18, 2018

Conversation

Projects
None yet
2 participants
@ncaq
Copy link
Contributor

ncaq commented Apr 17, 2018

Before submitting your PR, check that you've:

After submitting your PR:

  • Update the Changelog.md file with a link to your PR
  • Check that CI passes (or if it fails, for reasons unrelated to your change, like CI timeouts)

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.

@@ -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.

This comment has been minimized.

Copy link
@snoyberg

snoyberg Apr 17, 2018

Member

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.

This comment has been minimized.

Copy link
@snoyberg

snoyberg Apr 17, 2018

Member

Can you add a ChangeLog entry, cabal version bump, and a @since comment?

This comment has been minimized.

Copy link
@ncaq

ncaq Apr 17, 2018

Author Contributor

I thinked that wait other pull request.
However, If I should write before it, I write.
So I write.

addContentDispositionFileName :: MonadHandler m => T.Text -> m ()
addContentDispositionFileName name
= addHeader "Content-Disposition" $
"attachment; filename*=UTF-8''" `mappend` decodeUtf8 (H.urlEncode True (encodeUtf8 name))

This comment has been minimized.

Copy link
@snoyberg

snoyberg Apr 17, 2018

Member

I haven't seen this syntax before. Can you reference the relevant spec that details how this is supposed to work in a comment?

ncaq added some commits Apr 17, 2018

@ncaq ncaq force-pushed the ncaq:add-addContentDispositionFileName branch from d03ff94 to a59ee6b Apr 17, 2018

@ncaq

This comment has been minimized.

Copy link
Contributor Author

ncaq commented Apr 17, 2018

@snoyberg I wrote comment, changelog.

@snoyberg snoyberg merged commit b92b2a0 into yesodweb:master Apr 18, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@snoyberg

This comment has been minimized.

Copy link
Member

snoyberg commented Apr 18, 2018

Thanks!

@ncaq ncaq deleted the ncaq:add-addContentDispositionFileName branch Apr 18, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.