We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When working with branch names that contain special characters (including but not limited to slashes), BranchClient performs incorrect HTTP requests.
URL encoding for the branchName parameter should be added to the following methods:
branchName
The text was updated successfully, but these errors were encountered:
Hi @Khubajsn i think you have to URL-encoded the branch name link this: ... = System.Web.HttpUtility.UrlEncode(branchName)
GitLab documentation: File path, branches, and tags name encoding
But there is also a problem with the parser UriParser class in .NET 4.x if you use %2f in the URL
Workaround .. without warranty
public async Task<T> Get<T>(string url) { System.Uri tmpUri = null; if (!url.ToLower().Contains("%2f")) { tmpUri = new System.Uri(url, System.UriKind.Relative); } else { string absoluteUri = string.Format("{0}{1}", _client.BaseAddress.AbsoluteUri, url); tmpUri = new System.Uri(absoluteUri); string paq = tmpUri.PathAndQuery; // you have to access to the PathAndQuery property System.Reflection.FieldInfo fieldInfoFlags = typeof(Uri).GetField("m_Flags", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic); ulong flags = (ulong)fieldInfoFlags.GetValue(tmpUri); flags &= ~((ulong)0x30); // Flags.PathNotCanonical (0x10) | Flags.QueryNotCanonical (0x20) fieldInfoFlags.SetValue(tmpUri, flags); } var responseMessage = await _client.GetAsync(tmpUri); await EnsureSuccessStatusCode(responseMessage); return await ReadResponse<T>(responseMessage); }
Sorry, something went wrong.
No branches or pull requests
When working with branch names that contain special characters (including but not limited to slashes), BranchClient performs incorrect HTTP requests.
URL encoding for the
branchName
parameter should be added to the following methods:The text was updated successfully, but these errors were encountered: