Skip to content

fix tests for https://github.com/matrix-org/synapse/pull/2090#350

Merged
richvdh merged 8 commits into
developfrom
matthew/fix-filename-escaping
Mar 11, 2019
Merged

fix tests for https://github.com/matrix-org/synapse/pull/2090#350
richvdh merged 8 commits into
developfrom
matthew/fix-filename-escaping

Conversation

@ara4n
Copy link
Copy Markdown
Member

@ara4n ara4n commented Apr 1, 2017

No description provided.

@leonerd
Copy link
Copy Markdown
Contributor

leonerd commented Jun 20, 2017

LGTM

@richvdh richvdh requested a review from a team February 27, 2019 23:21
@richvdh richvdh force-pushed the matthew/fix-filename-escaping branch from 65b1f3c to 5c1f1e7 Compare February 27, 2019 23:36
@richvdh
Copy link
Copy Markdown
Member

richvdh commented Feb 27, 2019

Again I've rewritten much of this so a re-review would be appreciated. It looks somewhat more complicated than it is. In a nutshell:

  • factor out the common parts of some of the tests in 01unicode, 02nofilename, 03ascii into shared functions upload_test_content, get_media.
  • replace two "Can download with ASCII file name..." tests with a loop which downloads the file from both places, and tests a bunch of other filenames besides.
  • remove a couple of redundant calls to test_using_client.

Comment thread tests/51media/03ascii.pl Outdated
my $path = $parsed_uri->path;
# synapse uses filename* encoding for this, though regular filename encoding
# with a quoted string would be valid too
"name with spaces" => "inline; filename*=utf-8''name%20with%20spaces",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It would be nice if this was a map of file names to a list of valid content dispositions, so we don't force synapse's choice on other projects

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

that's not quite as easy as it sounds. have made it parse the header.

@richvdh richvdh self-assigned this Mar 7, 2019
Actually parse the header properly rather than checking it matches a hardcoded
string.
@richvdh richvdh requested a review from erikjohnston March 7, 2019 23:01
@richvdh richvdh merged commit 83ef6a4 into develop Mar 11, 2019
@richvdh richvdh deleted the matthew/fix-filename-escaping branch March 11, 2019 09:54
anoadragon453 added a commit that referenced this pull request Mar 13, 2019
…server_specific_tests

* 'develop' of github.com:matrix-org/sytest: (44 commits)
  test endpoint for updating backup versions (#559)
  Add test for transferring bans on a room upgrade (#563)
  fix tests for matrix-org/synapse#2090 (#350)
  Fix typo
  Fixup
  Incorporate review
  Remove prev_state from federation API
  Make the userdir synced not rely on being able to search for yourself (#567)
  Add basic soft fail test
  Check that event_id is given over state fetching over federation (#566)
  Fix registration rate limiting settings
  Fix comments
  Make sytest support auth rate limiting
  Fixup to not send 100 messages
  Test history visibility works for backfill
  Check that Server ACLs are preserved on room upgrade
  Better diagnostics from synapse startup (#561)
  Don't set PYTHONPATH when running synapse (#560)
  Regression test for redactions in room v3 (#558)
  Add test for PDU limit on transactions API (#555)
  ...
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.

4 participants