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

chore: Add trailing slashes to package and registration v3 endpoints #207

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
Loading