Skip to content

internal/gitserver: Add method Client.httpPostWithURI

Administrator requested to merge ig/gitserver-client into main

Created by: indradhanush

Why

This is follow up work on #26567. While in that PR we added a new Client method RequestRepoMigrate, it implicitly relies on the op argument's value to be prefixed with http. This would ensure that the Client.do method does not apply any transformations to the URI here.

However this is a buggy implementation since this does not guarantee that the address would be prefixed with http. As a result this PR introduces an internal API change which:

  • Makes the implicit edge-case handling of op prefixed with http explicit
  • Fixes the buggy implementation (even the tests) for Client.RequestRepoMigrate

What

The internal API changes are:

Client.do now accepts a URI instead of a path. It is now dumber (as it should be) as a result and does not care if the path has an HTTP prefix or not.

Client.httpPost will now apply the MD5 hashing scheme on the repo name to determine the URI, before invoking Client.do.

A new method, Client.httpPostWithURI which does not apply any transformations to the URI and sends the HTTP POST request as-is.

Merge request reports

Loading