Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.
/ NuGet.Jobs Public archive

Commit

Permalink
Merge branch 'dev' into master (#710)
Browse files Browse the repository at this point in the history
  • Loading branch information
joelverhagen committed Dec 10, 2019
2 parents 2f90969 + a6048ea commit 180ddca
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/NuGet.Services.SearchService/App_Start/WebApiConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Threading.Tasks;
using System.Web.Hosting;
using System.Web.Http;
using System.Web.Http.Cors;
using Autofac;
using Autofac.Extensions.DependencyInjection;
using Autofac.Integration.WebApi;
Expand Down Expand Up @@ -44,6 +45,15 @@ public static void Register(HttpConfiguration config)
var dependencyResolver = GetDependencyResolver(config);
config.DependencyResolver = dependencyResolver;

config.EnableCors(new EnableCorsAttribute(
origins: "*",
headers: "Content-Type,If-Match,If-Modified-Since,If-None-Match,If-Unmodified-Since,Accept-Encoding",
methods: "GET,HEAD,OPTIONS",
exposedHeaders: "Content-Type,Content-Length,Last-Modified,Transfer-Encoding,ETag,Date,Vary,Server,X-Hit,X-CorrelationId")
{
PreflightMaxAge = 3600
});

config.MapHttpAttributeRoutes();

config.Routes.MapHttpRoute(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@
<PackageReference Include="Microsoft.AspNet.WebApi">
<Version>5.2.7</Version>
</PackageReference>
<PackageReference Include="Microsoft.AspNet.WebApi.Cors">
<Version>5.2.7</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NuGet.Indexing\NuGet.Indexing.csproj">
Expand Down

0 comments on commit 180ddca

Please sign in to comment.