From ee38228ef0bb4bbb282085072701cc5d42087a01 Mon Sep 17 00:00:00 2001 From: mirsking Date: Thu, 1 Sep 2016 13:41:47 +0800 Subject: [PATCH] support key as segment, and add Access-Control-Allow-Origin: * in response header for CORS --- .../App_Start/WebApiConfig.cs | 4 +++- .../Web.config | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/test/ODataEndToEnd/Microsoft.OData.Service.Sample.TrippinInMemory/App_Start/WebApiConfig.cs b/test/ODataEndToEnd/Microsoft.OData.Service.Sample.TrippinInMemory/App_Start/WebApiConfig.cs index ace3158f..d5908dfc 100644 --- a/test/ODataEndToEnd/Microsoft.OData.Service.Sample.TrippinInMemory/App_Start/WebApiConfig.cs +++ b/test/ODataEndToEnd/Microsoft.OData.Service.Sample.TrippinInMemory/App_Start/WebApiConfig.cs @@ -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; @@ -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( diff --git a/test/ODataEndToEnd/Microsoft.OData.Service.Sample.TrippinInMemory/Web.config b/test/ODataEndToEnd/Microsoft.OData.Service.Sample.TrippinInMemory/Web.config index d008b610..b337d7ed 100644 --- a/test/ODataEndToEnd/Microsoft.OData.Service.Sample.TrippinInMemory/Web.config +++ b/test/ODataEndToEnd/Microsoft.OData.Service.Sample.TrippinInMemory/Web.config @@ -28,6 +28,12 @@ + + + + + +