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

Fix encoding mismatch in JS #28749

Merged
merged 3 commits into from Aug 22, 2017
Merged

Fix encoding mismatch in JS #28749

merged 3 commits into from Aug 22, 2017

Conversation

PVince81
Copy link
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.
Copy link
Member

@individual-it individual-it left a comment

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

Copy link
Contributor

@phil-davis phil-davis left a comment

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
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
Contributor Author

Backport of newdav + this PR here: #28769

@davitol
Copy link
Contributor

davitol commented Aug 22, 2017

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
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
Copy link

lock bot commented Aug 2, 2019

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