Problem/Motivation

We have a category in our DAM called "IF/THEN Collection" and since it has been created we see errors for requests to /acquia-dam/categories?category=IF%2FTHEN%20Collection while browsing the DAM in our site's media library that look like:

Client error: `GET
https://api.widencollective.com/v2/categories/IF/THEN%20Collection` resulted
in a `401 Unauthorized` response:
{
"error": true,
"response_code": 401,
"error_message": "Unauthorized",
"stack_trace": null
}

All the other categories are working fine, so I suspect the handling of the slash in the category name is the culprit. Quoting Widen API documentation:

“Slashes in category names must be escaped with a preceeding backslash (%5C%2F).”

CommentFileSizeAuthor
#4 3491071-4_reproduced-on-1.1.x.png38.45 KBbaluertl

Issue fork acquia_dam-3491071

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

cyu created an issue. See original summary.

cyu’s picture

Issue summary: View changes
japerry’s picture

Pushing this to the top to verify before we make the 1.1 release.

baluertl’s picture

StatusFileSize
new38.45 KB

While I was working on other things, I just stumbled upon the same on the latest 1.1.x-dev version as well:

Screenshot

Memo: whoever will work on this, please make sure that all other non-URL-friendly characters are also tested for, not only the forward slash. Thanks!

baluertl’s picture

Issue summary: View changes
deepakkm’s picture

Assigned: Unassigned » deepakkm
Status: Active » Needs work

rajeshreeputra made their first commit to this issue’s fork.

ankitv18’s picture

Version: 1.0.14 » 1.1.x-dev
Assigned: deepakkm » Unassigned

Add a comment on the MR, please check.

japerry’s picture

Status: Needs work » Fixed

That data shouldn't be getting passed raw, so I think encoding the return is the right thing here. Fixed!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.