Skip to content

Commit 0571ddc

Browse files
fitithwtechknowlogickwxiaoguang
authored
Case-insensitive NuGet symbol file GUID (#21409) (#21575)
Backport of #21409 Co-authored-by: techknowlogick <[email protected]> Co-authored-by: wxiaoguang <[email protected]>
1 parent 6b7ce72 commit 0571ddc

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

integrations/api_packages_nuget_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ AAAjQmxvYgAAAGm7ENm9SGxMtAFVvPUsPJTF6PbtAAAAAFcVogEJAAAAAQAAAA==`)
286286
req = AddBasicAuthHeader(req, user.Name)
287287
MakeRequest(t, req, http.StatusNotFound)
288288

289-
req = NewRequest(t, "GET", fmt.Sprintf("%s/symbols/%s/%sFFFFFFFF/%s", url, symbolFilename, symbolID, symbolFilename))
289+
req = NewRequest(t, "GET", fmt.Sprintf("%s/symbols/%s/%sFFFFffff/%s", url, symbolFilename, symbolID, symbolFilename))
290290
req = AddBasicAuthHeader(req, user.Name)
291291
MakeRequest(t, req, http.StatusOK)
292292

routers/api/packages/api.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ func Routes() *web.Route {
190190
r.Put("/symbolpackage", nuget.UploadSymbolPackage)
191191
r.Delete("/{id}/{version}", nuget.DeletePackage)
192192
}, reqPackageAccess(perm.AccessModeWrite))
193-
r.Get("/symbols/{filename}/{guid:[0-9a-f]{32}}FFFFFFFF/{filename2}", nuget.DownloadSymbolFile)
193+
r.Get("/symbols/{filename}/{guid:[0-9a-fA-F]{32}[fF]{8}}/{filename2}", nuget.DownloadSymbolFile)
194194
}, reqPackageAccess(perm.AccessModeRead))
195195
})
196196
r.Group("/npm", func() {

routers/api/packages/nuget/nuget.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ func processUploadedFile(ctx *context.Context, expectedType nuget_module.Package
351351
// DownloadSymbolFile https://github.com/dotnet/symstore/blob/main/docs/specs/Simple_Symbol_Query_Protocol.md#request
352352
func DownloadSymbolFile(ctx *context.Context) {
353353
filename := ctx.Params("filename")
354-
guid := ctx.Params("guid")
354+
guid := ctx.Params("guid")[:32]
355355
filename2 := ctx.Params("filename2")
356356

357357
if filename != filename2 {

0 commit comments

Comments
 (0)