Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

404 Exception for some branches names #672

Closed
greymag opened this issue Nov 8, 2021 · 1 comment · Fixed by #682
Closed

404 Exception for some branches names #672

greymag opened this issue Nov 8, 2021 · 1 comment · Fixed by #682

Comments

@greymag
Copy link

greymag commented Nov 8, 2021

If I want to call compare() for some branch with / in name, for example:

// Arrange
$client = new Gitlab\Client();
$client->setUrl($this->_url);
$client->authenticate($this->_token, Gitlab\Client::AUTH_HTTP_TOKEN);

$projectId = 123;

// Act
$res = $client->repositories()->compare($projectId, 'develop', 'feature/760.fake-branch');

Than I get an exception:

404 Ref Not Found

If I trace request, I can see that name of brach was encoded twice:

http:https://gitlab.mycompany.com/api/v4/projects/123/repository/compare?from=develop&to=feature%252F760.fake-branch&straight=false

Which leads to "not found" result.

My compose.json requirements:

 "require": {
        "nyholm/psr7": "^1.4",
        "symfony/http-client": "^5.3",
        "m4tthumphrey/php-gitlab-api": "^11.4",
  }
@GrahamCampbell
Copy link
Member

Thanks for the report. This will be fixed shortly.

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

Successfully merging a pull request may close this issue.

2 participants