Skip to content

Commit

Permalink
Fix functional test failure SearchMicrosoftDotNetCuratedFeed #3941 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
xavierdecoster committed May 18, 2017
1 parent 56dd0f0 commit 3d34a45
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ private static void NormalizeNavigationLinks(ODataEntry entry, HttpRequestMessag
private static Uri BuildIdLink(string id, string version, HttpRequestMessage request)
{
var packageIdentityQuery = $"(Id='{id}',Version='{version}')";
var localPath = request.RequestUri.LocalPath.Replace(packageIdentityQuery, string.Empty);
var localPath = request.RequestUri.LocalPath
// Remove closing brackets from Packages collection
.Replace("/Packages()", "/Packages")
// Remove package identity query
.Replace(packageIdentityQuery, string.Empty);

return new Uri($"{request.RequestUri.Scheme}://{request.RequestUri.Host}{localPath}{packageIdentityQuery}");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public void SetsAtomEntryMetadataAnnotation()

[Theory]
[InlineData("https://localhost/api/v2/Packages")]
[InlineData("https://localhost/api/v2/Packages()")]
[InlineData("https://localhost/api/v2/Packages(Id='SomePackageId',Version='1.0.0')")]
public void NormalizesNavigationLinksWhenSet(string requestUri)
{
Expand Down

0 comments on commit 3d34a45

Please sign in to comment.