imgix/js-core

If filename in path has spaces - signature becomes invalid

oaleynik opened this issue ยท 4 comments

Consider the following example:

var ImgixClient = require('imgix-core-js');

var client = new ImgixClient({
  host: "example.com",
  secureURLToken: "12345abcde",
  secure: true
});

var url = client.buildURL("/a/b/c/image with spaces.jpg", {
  fm: 'jpg',
  dpr: 2,
  w: 1500,
  sharp: 15
});

The above outputs: https://example.com/a/b/c/image with spaces.jpg?fm=jpg&dpr=2&w=1500&sharp=15&ixlib=js-1.0.7&s=5d03453c163fb3c22722a1b7d3fc874a when tool from web app outputs spaces URL encoded.

Request to the resulting URL returns 403 Invalid Signature. I needed to pin imgix-core-js version to 1.0.5 to avoid this.

This looks like regression of #7

jayeb commented

Augh, this method will be the death of me. I'll take a look at this sometime in the next few days and put together a fix. Thanks for the report, Oleg!

jayeb commented

Sorry for the delay here, @oaleynik. There's a PR open for this fix now: #29

๐ŸŽ‰ This issue has been resolved in version 0.3.0-beta.1 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€