Skip to content

Fix encoding mismatch in JS#28749

Merged
phil-davis merged 3 commits into
masterfrom
js-fileinfo-uri-encoding
Aug 22, 2017
Merged

Fix encoding mismatch in JS#28749
phil-davis merged 3 commits into
masterfrom
js-fileinfo-uri-encoding

Conversation

@PVince81

Copy link
Copy Markdown
Contributor

Description

Encode with encodeURIComponent again.
Note that "@" gets encoded to "%40" but when Sabre DAV returns a
PROPFIND response, the "@" in the URL is not encoded. To make sure that
the href root is properly match, we now compare each section
individually in their decoded form.

Related Issue

Fixes #28748

Motivation and Context

How Has This Been Tested?

JS unit tests.
Create a folder "test@?#" in the web UI and navigate into it.
Create a user "test@test" with a subfolder, navigate into it.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Encode with encodeURIComponent again.
Note that "@" gets encoded to "%40" but when Sabre DAV returns a
PROPFIND response, the "@" in the URL is not encoded. To make sure that
the href root is properly match, we now compare each section
individually in their decoded form.

@individual-it individual-it left a comment

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.

with the fix I could not reproduce the bug any-more.
added some UI tests, lets see what travis says.
@phil-davis please review my test cases

@phil-davis phil-davis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM - covers the set of chars that are commonly used as delimiters in URL/URIs.
What will be found next?

@PVince81

Copy link
Copy Markdown
Contributor Author

What will be found next?

Life on Mars

The client takes care of encoding them when doing the Webdav requests
@PVince81

Copy link
Copy Markdown
Contributor Author

Backport of newdav + this PR here: #28769

@davitol

davitol commented Aug 22, 2017

Copy link
Copy Markdown
Contributor

Tested and WFM 👍

@phil-davis phil-davis merged commit 68772d6 into master Aug 22, 2017
@phil-davis phil-davis deleted the js-fileinfo-uri-encoding branch August 22, 2017 13:28
@PVince81

Copy link
Copy Markdown
Contributor Author

one of the recent changes related to encoding have added new tests that somehow very indirectly trigger some annoying logs on the console "ERROR: undefined". I've fixed this in this follow up PR: #28772 (JS tests only)

@lock

lock Bot commented Aug 2, 2019

Copy link
Copy Markdown

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock Bot locked as resolved and limited conversation to collaborators Aug 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hash '#' or question-mark '?' is not accepted in filenames

6 participants