Skip to content

Commit

Permalink
support key as segment, and add Access-Control-Allow-Origin: * in res…
Browse files Browse the repository at this point in the history
…ponse header for CORS
  • Loading branch information
mirsking committed Sep 1, 2016
1 parent 0751716 commit ee38228
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System.Web.Http;
using System.Web.OData;
using System.Web.OData.Extensions;
using Microsoft.OData.Service.Sample.TrippinInMemory.Api;
using Microsoft.Restier.Publishers.OData;
using Microsoft.Restier.Publishers.OData.Batch;
Expand All @@ -13,9 +14,10 @@ public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
RegisterTrippin(config, GlobalConfiguration.DefaultServer);
config.SetUseVerboseErrors(true);
config.MessageHandlers.Add(new ETagMessageHandler());
config.SetUrlKeyDelimiter(ODataUrlKeyDelimiter.Slash);
RegisterTrippin(config, GlobalConfiguration.DefaultServer);
}

public static async void RegisterTrippin(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@
<remove name="TRACEVerbHandler" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*" verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>

<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
</customHeaders>
</httpProtocol>
</system.webServer>
<uri>
<schemeSettings>
Expand Down

0 comments on commit ee38228

Please sign in to comment.