fix: InvalidInputFile error occurs if file contains URI escaped charactors by filzrev · Pull Request #9700 · dotnet/docfx

Conversation

@filzrev

This PR intended to fix #5132.

What's included in this PR

  • Fix PathUtility.MakeRelativePath methods to use Path.GetRelativePath method if specified path is file protocol.
    • It seems file:// protocol can't be handled by this PathUtility.MakeRelativePath.
      So add fallback to use existing implementation (Uri::MakeRelativeUri)
  • Add additional tests for PathUtility.MakeRelativePath method.

@codecov

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (fe673ec) 74.31% compared to head (2a32f89) 74.29%.
Report is 23 commits behind head on main.

Files Patch % Lines
src/Docfx.Common/Path/PathUtility.cs 25.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9700      +/-   ##
==========================================
- Coverage   74.31%   74.29%   -0.03%     
==========================================
  Files         536      536              
  Lines       23189    23192       +3     
  Branches     4056     4058       +2     
==========================================
- Hits        17234    17230       -4     
- Misses       4853     4859       +6     
- Partials     1102     1103       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

yufeih

@yufeih yufeih added the bug-fix

Makes the pull request to appear in "Bug Fixes" section of the next release note

label

Feb 18, 2024

renovate bot referenced this pull request in dotnet/dotnet-operator-sdk

Feb 18, 2024

p-kostov pushed a commit to ErpNetDocs/docfx that referenced this pull request

Jun 28, 2024
…ctors (dotnet#9700)

* fix: InvalidInputFile error occurs if file contains URI escaped characters

* chore: remove not redundant setting.

@filzrev filzrev deleted the fix-error-when-filename-contains-urlespaced-chars branch

July 13, 2024 11:18

Labels

bug-fix

Makes the pull request to appear in "Bug Fixes" section of the next release note

2 participants

@filzrev @yufeih