-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Automatically decode cookie values in Cookies dictionary #1390
Conversation
A new test to check if the cookie value is correctly decoded on reading from Request.Cookies and a fix for the existing issue the test highlights.
[Fact] | ||
public void Cookie_should_decode_value_correctly() | ||
{ | ||
// When |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make it Given & When
Broke out cookie test module into its own file and rewrote test into Given When format.
@richardprice Travis does not like this one. Tell me something's gone boo-boo
|
Still had failing tests when I ran it locally. Moved this to 0.23 because maybe we need to remake so that the cookie behavior is consistent between Request ( |
Thanks VS2012 for hiding these on Friday, for whatever reason you chose to.
Do you want me to go ahead and start on the normalisation between Request and Response cookie handling? |
@richardprice I think we need to discuss this first. Will talk to @grumpydev when the dust of the |
@@ -177,7 +177,8 @@ public string Path | |||
} | |||
} | |||
|
|||
cookieDictionary[cookieName] = parts[1]; | |||
cookieDictionary[cookieName] = Helpers.HttpUtility.UrlDecode(parts[1]); | |||
//cookieDictionary[cookieName] = parts[1]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented out code? :)
Moving this to 1.4 milestone. @richardprice could you rebase so we have a running version to discuss on? Thanks ❤️ |
ping @richardprice |
Sorry, missed this first time round, will sort soon. On 24 September 2015 at 14:46, Jonathan Channon [email protected]
The most exciting phrase to hear in science, the one that heralds new |
A new test to check if the cookie value is correctly decoded on reading from Request.Cookies and a fix for the existing issue the test highlights.
Broke out cookie test module into its own file and rewrote test into Given When format.
Thanks VS2012 for hiding these on Friday, for whatever reason you chose to.
…Spike Conflicts: src/Nancy.Hosting.Wcf.Tests/NancyWcfGenericServiceFixture.cs src/Nancy.sln.DotSettings src/Nancy/Request.cs src/Nancy/Session/CookieBasedSessions.cs
This is good to go now? |
Yup. On 28 October 2015 at 19:50, Kristian Hellang [email protected]
The most exciting phrase to hear in science, the one that heralds new |
using Testing; | ||
using Xunit; | ||
|
||
public class CookieTestsFixture |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@richardprice Can you either 1) rename the class, or 2) rename the file? 😄 And maybe not include both "tests" and "fixture"?
Added test and fix for cookie decoding issue
❤️ Sorry it took almost 2 years 😝 |
This is a breaking change. If you manually decode cookies from the - var cookie = HttpUtility.UrlDecode(request.Cookies[cookieName]);
+ var cookie = request.Cookies[cookieName]; |
Added test and fix for cookie decoding issue
A new test to check if the cookie value is correctly decoded on reading
from Request.Cookies and a fix for the existing issue the test
highlights.