Skip to content

Conversation

@ggallotti
Copy link
Member

@ggallotti ggallotti commented Aug 3, 2022

This code :
&HttpResponse.AddHeader(!"Content-Disposition", !'attachment; filename=注文詳細.xlsx')

Gets garbled http download filename in Safari.

Change log:

  • We now use RFC5987 " Character Set and Language Encoding for Hypertext Transfer Protocol (HTTP) Header Field Parameters" for encoding filename attribute inside Content-Disposition Header. We fallback to the original method when somethig fails.
  • Safari does not support RFC5987 nor String encoded Filename atribute, so we disable encoding for this Browser until RFC5987 get supported.

@ggallotti ggallotti temporarily deployed to external-storage-tests August 3, 2022 18:53 Inactive
@ggallotti ggallotti changed the title Content-Disposition Header not working on Safari Content-Disposition filename gets garbled filename for Japanese Characters in Safari. Aug 4, 2022
@ggallotti ggallotti marked this pull request as ready for review August 4, 2022 13:54
@genexusbot
Copy link
Collaborator

Cherry pick to beta failed, 1 conflicted file in commit fd71286
  • dotnet/src/dotnetframework/GxClasses/Helpers/HttpHelper.cs

@genexusbot genexusbot added the conflict Conflict merging to beta branch label Aug 4, 2022
@ggallotti ggallotti removed the conflict Conflict merging to beta branch label Aug 4, 2022
Copy link
Collaborator

@claudiamurialdo claudiamurialdo left a comment

Choose a reason for hiding this comment

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

Could GetEncodedContentDisposition be internal instead of public?

@ggallotti
Copy link
Member Author

Could GetEncodedContentDisposition be internal instead of public?

If I change to internal, UnitTest Project fails to compile. What do you suggest?

@genexusbot
Copy link
Collaborator

Cherry pick to beta failed, 1 conflicted file in commit fd71286
  • dotnet/src/dotnetframework/GxClasses/Helpers/HttpHelper.cs

@ggallotti ggallotti temporarily deployed to external-storage-tests August 5, 2022 14:34 Inactive
@genexusbot genexusbot added the conflict Conflict merging to beta branch label Aug 5, 2022
@claudiamurialdo
Copy link
Collaborator

Could GetEncodedContentDisposition be internal instead of public?

If I change to internal, UnitTest Project fails to compile. What do you suggest?

Try adding
[assembly: InternalsVisibleTo("DotNetCoreUnitTest")]

to AssemblyInfo.cs of GxClasses.dll

@ggallotti ggallotti temporarily deployed to external-storage-tests August 5, 2022 15:30 Inactive
@ggallotti ggallotti removed the conflict Conflict merging to beta branch label Aug 5, 2022
@genexusbot
Copy link
Collaborator

Cherry pick to beta failed, 3 conflicted files in commit fd71286
  • dotnet/src/dotnetframework/GxClasses/Core/Web/GxHttpServer.cs
  • dotnet/src/dotnetframework/GxClasses/Helpers/HttpHelper.cs
  • dotnet/test/DotNetCoreUnitTest/HttpUtils/HttpUtils.cs

@ggallotti ggallotti temporarily deployed to external-storage-tests August 5, 2022 18:56 Inactive
@genexusbot genexusbot added the conflict Conflict merging to beta branch label Aug 5, 2022
@ggallotti ggallotti removed the conflict Conflict merging to beta branch label Aug 5, 2022
@ggallotti
Copy link
Member Author

@claudiamurialdo : This is ready to review. Thanks!

@ggallotti ggallotti merged commit 001b444 into master Aug 16, 2022
@ggallotti ggallotti deleted the content-disposition branch August 16, 2022 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants