Created
September 29, 2011 17:12
-
-
Save majimenezp/1251302 to your computer and use it in GitHub Desktop.
The owin host in kayak not set the cookies, i added this code and works
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void InvokeNancy(NancyRequestParameters parameters, ResponseCallBack responseCallBack, Action<Exception> errorCallback) | |
{ | |
try | |
{ | |
parameters.Body.Seek(0, SeekOrigin.Begin); | |
var request = new Request(parameters.Method, parameters.Url, parameters.Body, parameters.Headers); | |
// Execute the nancy async request handler | |
this.engine.HandleRequest( | |
request, | |
(result) => | |
{ | |
var returnCode = GetReturnCode(result); | |
var headers = result.Response.Headers; | |
//Modification start | |
//Code to add cookies in headers | |
foreach (var cookie in result.Response.Cookies) | |
{ | |
headers.Add("Set-Cookie", cookie.ToString()); | |
} | |
//Modification end | |
responseCallBack.Invoke(returnCode, headers, GetResponseBodyBuilder(result)); | |
}, | |
errorCallback); | |
} | |
catch (Exception e) | |
{ | |
errorCallback.Invoke(e); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment