project Websites / Gitlab Issue Listing Script avatar

websites/Gitlab-Issue-Listing-Script#47: Gitlab API doesn't like URL-Encoded label names

Issue Information

Issue Type: issue
Status: closed
Reported By: btasker
Assigned To: btasker

Milestone: v0.5
Created: 26-Aug-22 16:11


As a follow on from #46 I checked that API calls didn't break when a label name included a /.

They do, and commit 176375b introduced an urlencode() call, which fixed fetching of label names like Resolution::Fixed/Done.

However it's broken fetch of Resolution::Won't Fix

Urlencode changes that to Resolution%3A%3AWon%27t+Fix which Gitlab's API apparently doesn't like.

It looks like it's the + that it doesn't like, expecting %20 instead.

Toggle State Changes


assigned to @btasker

Switching from urlencode() to rawurlencode() fixes this.

The latter observes RFC3986 whilst urlencode() uses the old approach.

I'll leave this marked as a Gitlab API Foible - it's not unreasonable of them to expect RFC compliance, but it's such a common thing you'd expect it to be handled (IMO).