Skip to content

Allow filename= formatted Content-Disposition#892

Merged
neilalexander merged 5 commits intodevelopfrom
neilalexander/mediadisposition
Jun 16, 2020
Merged

Allow filename= formatted Content-Disposition#892
neilalexander merged 5 commits intodevelopfrom
neilalexander/mediadisposition

Conversation

@neilalexander
Copy link
Contributor

In the Content-Disposition header, Synapse uses inline; filename*=utf-8''foo but Dendrite uses inline; filename=utf-8\"foo\".

This updates the test to support both, rather than just the former.

Additional info in Synapse's own source code: https://github.com/matrix-org/synapse/blob/a3f11567d930b7da0db068c3b313f6f4abbf12a1/synapse/rest/media/v1/_base.py#L122-L140

@neilalexander neilalexander marked this pull request as ready for review June 16, 2020 16:52
Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

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

couple of nits

my ( $cd_params ) = @_;
assert_eq( $cd_params->{'filename*'}, "utf-8''$FILENAME_ENCODED", "filename*" );

if (exists( $cd_params->{'filename'} )) {
Copy link
Member

Choose a reason for hiding this comment

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

could you add a comment saying what this is doing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Have added some comments.

Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

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

lgtm

@neilalexander neilalexander merged commit 4e1aa9d into develop Jun 16, 2020
@neilalexander neilalexander deleted the neilalexander/mediadisposition branch June 16, 2020 17:10
anoadragon453 added a commit that referenced this pull request Aug 4, 2020
* origin/release-v1.16.0: (21 commits)
  Add missing DB
  Fix typing leak test to use /sync and true
  Use /sync and not /events for invite tests
  Use true not 1 when setting typing
  Revert "Merge mainline release v1.15.1 into dinsic"
  Use matrix_invite_user_to_room_synced on remote invite tests
  Remove unused variables. (#899)
  remove testing file
  Update tests/30rooms/20typing.pl
  Make invite tests use /sync not room /initialSync
  Refactor to log typing events and bail earlier
  perldoc
  Get the operator correct
  Don't fail the test if there are users typing on the stop typing test
  Make typing tests use /sync not /events
  Remove dependency on room initial sync for name/topic tests
  Fix a warning about referencing a scalar. (#893)
  Add event ID to /send_join requests rather than 'xxx'
  Implement MSC2625 (unread counters) (#890)
  Allow filename= formatted Content-Disposition (#892)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants