Created
November 18, 2010 12:02
-
-
Save andrewdavey/704900 to your computer and use it in GitHub Desktop.
Potential encoding bug in RavenDB's /static response
This file contains hidden or 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
static void StaticKeyBug() | |
{ | |
using (var store = new DocumentStore()) | |
{ | |
store.Url = "http://localhost:8080"; | |
store.Initialize(); | |
store.DatabaseCommands.PutAttachment("test/hello/world", null, new byte[] { 1, 2, 3 }, new JObject()); | |
using (var wc = new WebClient()) | |
{ | |
var staticJson = wc.DownloadString("http://localhost:8080/static"); | |
foreach (var item in JArray.Parse(staticJson)) | |
{ | |
Console.WriteLine(item["Key"].ToString()); | |
} | |
// My output looks like this: | |
//"t\u0000e\u0000s\u0000t\u0000/\u0000h\u0000e\u0000l\u0000l\u0000o\u0000/\u0000w\u0000o\u0000r\u0000l\u0000d\u0000" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment