Skip to content

Commit

Permalink
chore: Add trailing slashes to package and registration v3 endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
Regenhardt committed Jan 2, 2025
1 parent 08e7af9 commit 26518d6
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/BaGetter.Web/BaGetterUrlGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ public string GetServiceIndexUrl()

public string GetPackageContentResourceUrl()
{
return AbsoluteUrl("v3/package");
return AbsoluteUrl("v3/package/");
}

public string GetPackageMetadataResourceUrl()
{
return AbsoluteUrl("v3/registration");
return AbsoluteUrl("v3/registration/");
}

public string GetPackagePublishResourceUrl()
Expand Down
4 changes: 2 additions & 2 deletions tests/BaGetter.Tests/ApiIntegrationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public async Task SearchReturnsOk()
Assert.Equal(@"{
""@context"": {
""@vocab"": ""http://schema.nuget.org/schema#"",
""@base"": ""http://localhost/v3/registration""
""@base"": ""http://localhost/v3/registration/""
},
""totalHits"": 1,
""data"": [
Expand Down Expand Up @@ -93,7 +93,7 @@ public async Task SearchReturnsEmpty()
Assert.Equal(@"{
""@context"": {
""@vocab"": ""http://schema.nuget.org/schema#"",
""@base"": ""http://localhost/v3/registration""
""@base"": ""http://localhost/v3/registration/""
},
""totalHits"": 0,
""data"": []
Expand Down
4 changes: 2 additions & 2 deletions tests/BaGetter.Tests/MirrorIntegrationTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.IO;
using System.Net;
using System.Net.Http;
Expand Down Expand Up @@ -38,7 +38,7 @@ public async Task SearchExcludesUpstream()
Assert.Equal(@"{
""@context"": {
""@vocab"": ""http://schema.nuget.org/schema#"",
""@base"": ""http://localhost/v3/registration""
""@base"": ""http://localhost/v3/registration/""
},
""totalHits"": 0,
""data"": []
Expand Down
2 changes: 1 addition & 1 deletion tests/BaGetter.Tests/TestData/TestData.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions tests/BaGetter.Tests/TestData/TestData.resx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Expand Down Expand Up @@ -118,6 +118,6 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="ServiceIndex" xml:space="preserve">
<value>{"version":"3.0.0","resources":[{"@id":"http://localhost/api/v2/package","@type":"PackagePublish/2.0.0"},{"@id":"http://localhost/api/v2/symbol","@type":"SymbolPackagePublish/4.9.0"},{"@id":"http://localhost/v3/search","@type":"SearchQueryService"},{"@id":"http://localhost/v3/search","@type":"SearchQueryService/3.0.0-beta"},{"@id":"http://localhost/v3/search","@type":"SearchQueryService/3.0.0-rc"},{"@id":"http://localhost/v3/registration","@type":"RegistrationsBaseUrl"},{"@id":"http://localhost/v3/registration","@type":"RegistrationsBaseUrl/3.0.0-rc"},{"@id":"http://localhost/v3/registration","@type":"RegistrationsBaseUrl/3.0.0-beta"},{"@id":"http://localhost/v3/package","@type":"PackageBaseAddress/3.0.0"},{"@id":"http://localhost/v3/autocomplete","@type":"SearchAutocompleteService"},{"@id":"http://localhost/v3/autocomplete","@type":"SearchAutocompleteService/3.0.0-rc"},{"@id":"http://localhost/v3/autocomplete","@type":"SearchAutocompleteService/3.0.0-beta"}]}</value>
<value>{"version":"3.0.0","resources":[{"@id":"http://localhost/api/v2/package","@type":"PackagePublish/2.0.0"},{"@id":"http://localhost/api/v2/symbol","@type":"SymbolPackagePublish/4.9.0"},{"@id":"http://localhost/v3/search","@type":"SearchQueryService"},{"@id":"http://localhost/v3/search","@type":"SearchQueryService/3.0.0-beta"},{"@id":"http://localhost/v3/search","@type":"SearchQueryService/3.0.0-rc"},{"@id":"http://localhost/v3/registration/","@type":"RegistrationsBaseUrl"},{"@id":"http://localhost/v3/registration/","@type":"RegistrationsBaseUrl/3.0.0-rc"},{"@id":"http://localhost/v3/registration/","@type":"RegistrationsBaseUrl/3.0.0-beta"},{"@id":"http://localhost/v3/package/","@type":"PackageBaseAddress/3.0.0"},{"@id":"http://localhost/v3/autocomplete","@type":"SearchAutocompleteService"},{"@id":"http://localhost/v3/autocomplete","@type":"SearchAutocompleteService/3.0.0-rc"},{"@id":"http://localhost/v3/autocomplete","@type":"SearchAutocompleteService/3.0.0-beta"}]}</value>
</data>
</root>

0 comments on commit 26518d6

Please sign in to comment.