Skip to content

Conversation

wilkolazki
Copy link
Contributor

I found a bug where methods Jobs::shouldGetArtifactsByRefName and Jobs::shouldGetArtifactByRefName unnecesarily call self::encodePath() to encode query parameters, while all the query parameters are later encoded again in AbstractApi::prepareUri by call to QueryStringBuilder::build().

I've corrected those two methods and modified tests acordingly. I have not checked other methods for similar bugs, but I think it is probable it is there.

Removed call to self::encodePath, as the `job` parameter is part of a url query, which is later encoded by `QueryStringBuilder` in `AbstractApi::prepareUri`
@GrahamCampbell GrahamCampbell changed the title Fix double encoding of job name in artifacts download [11.11] Fix double encoding of job name in artifacts download Sep 8, 2023
@GrahamCampbell GrahamCampbell merged commit 62acfd1 into GitLabPHP:11.11 Oct 8, 2023
@GrahamCampbell
Copy link
Member

Thanks.

GrahamCampbell pushed a commit that referenced this pull request Oct 8, 2023
* Fix double encoding of $job_name

Removed call to self::encodePath, as the `job` parameter is part of a url query, which is later encoded by `QueryStringBuilder` in `AbstractApi::prepareUri`

* Use `job name` with space to test url encoding
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants