Skip to content

GitLab outbound notes double-encode project paths #4354

Done

Description

@CryoThrust

Problem

On main (a067f5cd1), GitLabOutboundClient.sendOne() URL-encodes path_with_namespace before passing it to a WebClient URI-template variable. WebClient encodes the percent signs again.

For a webhook project team/project, the actual request is:

POST /api/v4/projects/team%252Fproject/issues/42/notes

GitLab expects team%2Fproject as the project identifier. Nested groups have the same problem for merge-request replies.

Reproduction and proposed fix

A local HTTP-server regression calls the real outbound client and captures the request's raw path, token header and JSON body. Three cases fail on main (ordinary project, subgroup project, hyphenated project), with %252F instead of %2F; a blank-message control passes. No GitLab credentials or live service are involved.

I am preparing a small fix: pass the original project path to the URI template and let WebClient encode it once. No public API or address format changes. The regression also covers issue versus merge-request routing and ordered delivery of two messages.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions