blanks in tileUrls not caught when appending cache string (+ fix)
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 380
- Forks
- 140
- PR merge metrics
- No merged PRs in 30d
Description
Some tile server returned urls with blanks at the end. After appending the cache string the url was invalid (....jpeg%20%20%20%20?cache=...)
Fixed this by removing blanks in addCacheString()
```
function addCacheString(url) {
// If it's a data URL we don't want to touch this.
url = url.replace(/\s+/g,'');
if (isDataURL(url) || url.indexOf('mapbox.com/styles/v1') !== -1) {
return url;
}
return url + ((url.match(/\?/)) ? '&' : '?') + 'cache=' + cacheBusterDate;
}
```
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by searching the codebase for the addCacheString() function mentioned in the issue and inspect how tile URLs are passed to it. Verify that trailing whitespace is removed before the cache string is appended, while data URLs remain unaffected; no test file is mentioned in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100