Skip to content

FS: Can't open image from custom FileSystemProvider #85190

Closed

Description

  1. Change an image in a git repo.
  2. In the SCM view, right click the change and select Open File (HEAD) to open the original image.

Git will attempt to open a Uri which has the following query, all properly encoded:

path=%2Fhome%2Fjoao%2FWork%2Ffakeproject%2Fcode_150x150.png&ref=~

There will be a call to stat with the correct Uri, with the same query property:

image

But the call to readFile will have a Uri with a double encoded query property:

image

path%3D%252Fhome%252Fjoao%252FWork%252Ffakeproject%252Fcode_150x150.png%26ref%3D~

Activity

  1. joaomoreno commented on Nov 20, 2019

    @joaomoreno
    ContributorAuthor

    Does not repro with text files.

  2. bpasero commented on Nov 20, 2019

    @bpasero
    Contributor

    The file service is never doing anything with the URIs it gets (neither parse nor toString()). So I suspect something is going wrong maybe here:

    const result = await loadLocalResource(URI.parse(request.url), fileService, extensionLocation, getRoots);

  3. added
    bug
    webview
    on Nov 20, 2019
  4. joaomoreno commented on Nov 21, 2019

    @joaomoreno
    ContributorAuthor

    Works great, thanks Matt Bierner (@mjbvz) !

  5. locked and limited conversation to collaborators on Jan 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugverifiedwebview

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions