From 94ee01b54ad50562a9dfc6d308d06e3fb7b25c00 Mon Sep 17 00:00:00 2001 From: ericcoleman Date: Tue, 4 Sep 2018 15:46:49 -0400 Subject: [PATCH] Add route to match older Nuget.Server uploads (#62) --- src/NuGet.Server.V2/NuGetV2WebApiEnabler.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/NuGet.Server.V2/NuGetV2WebApiEnabler.cs b/src/NuGet.Server.V2/NuGetV2WebApiEnabler.cs index 98830c9f..9915b74f 100644 --- a/src/NuGet.Server.V2/NuGetV2WebApiEnabler.cs +++ b/src/NuGet.Server.V2/NuGetV2WebApiEnabler.cs @@ -53,6 +53,13 @@ public static HttpConfiguration UseNuGetV2WebApiFeed(this HttpConfiguration conf constraints: new { httpMethod = new HttpMethodConstraint(HttpMethod.Delete) } ); + config.Routes.MapHttpRoute( + name: "apiv2package_upload", + routeTemplate: "api/v2/package", + defaults: new { controller = oDatacontrollerName, action = "UploadPackage" }, + constraints: new { httpMethod = new HttpMethodConstraint(HttpMethod.Put) } + ); + config.Routes.MapODataServiceRoute(routeName, routeUrlRoot, oDataModel, new CountODataPathHandler(), conventions); return config; }