Esri / Esri/solution.js

Resource Filenames need to be URI Encoded

Open
#1,545 0 comments 0 reactions 1 assignee Claimed by @MikeTschudi View on GitHub
A - bug
Dominant language
TypeScript
Stars
48
Forks
16
PR merge metrics
No merged PRs in 30d

Description

PS logged a bug with the Hub team about a failure to convert a site to a template (aka a Solution). In our investigation we found that the issue was related to how Solution.js was fetching an image resource. The tldr is that file resource filenames can contain chars that are not valid in urls. e.g. the `[ `and `]` in this filename `AdobeStock_253484648%20[Converted].png`. The fix is to call `encodeURIComponent(...)` on the filename before making the request to get it... which is [here in Solution.js](https://github.com/Esri/solution.js/blob/develop/packages/creator/src/createItemTemplate.ts#L233)

I'm not sure this is the only place that this would need to be applied, but this is where I traced things back to.

Given how long this has been around, I don't think it's a high priority, but it looks like an easy fix

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.