Skip to content

URL Encoding Issue For Files with Spaces #17

Description

@jkkjonah

As of today, the smush.it api endpoint expects all spaces in file name to be URL encoded pluses (%2B).

e.g.:
Image Name = image with spaces.png

This returns null:
http://www.smushit.com/ysmush.it/ws.php?img=http://s3.amazonaws.com/BUCKET/image%20with%20spaces.png

This returns the expected response:
http://www.smushit.com/ysmush.it/ws.php?img=http://s3.amazonaws.com/BUCKET/image%2Bwith%2Bspaces.png

  1. The Autosmush library does not URL encode the image file path at all before calling CURL
  2. The special case of replacing spaces with plusses needs to be added before URL encoding

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions