timols / java-gitlab-api

A wrapper for the Gitlab API written in Java
Apache License 2.0
387 stars 316 forks source link

Files containing spaces in their path are wrongly encoded #331

Closed slauriere closed 5 years ago

slauriere commented 5 years ago

When file paths are sent to GitLab, their path gets encoded using the default java.net.URLEncoder which is documented as "an utility for HTML form encoding". However, URL form encoding differs from path encoding at least concerning the way spaces get encoded, as explained in details in this stackoverflow post. This means that the method "sanitizePath" of GitlabAPI should take this into account and convert "+" characters into the string "%20".

aubincleme commented 5 years ago

Hi @timols any update on this ? It seems that my team has the same issue.

Thanks !

slauriere commented 5 years ago

The fix was integrated in the latest release (4.1.1) – see GitLapAPI.java#L3441 – so I'm marking this issue as closed.