artifactory-client-java icon indicating copy to clipboard operation
artifactory-client-java copied to clipboard

"+" sign on property values

Open gpiress opened this issue 6 years ago • 1 comments

The issue

+ signs in property values will get replaced by empty spaces if set using the library. Works fine through the UI

The details

When using the client's withProperty method before uploading an artifact, + signs on the property value are replaced by empty spaces after uploading. This is specially problematic when setting artifactory.content-type values for svg files for example, that have image/svg+xml as MIME type. I tried escaping the plus signs with a backslash, but that didn't help. I don't see mentions of this anywhere either.

How to reproduce

Just use plus signs in property values.

java.io.File file = new java.io.File("fileToUpload.txt");
File deployed = artifactory.repository("RepoName")
    .upload("path/to/newName.txt", file)
    .withProperty("some-property", "should+keep+plus+signs")
    .doUpload();

Expected behavior

Keep plus signs as set or have some way of escaping them.

gpiress avatar Aug 06 '19 10:08 gpiress

I've opened a PR to fix this. The workaround for this issue is mentioned by @darewreck54 in #263.

dodie avatar Oct 23 '19 21:10 dodie