Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Reverting a bad merge

  • Loading branch information...
commit 805b2e030a361cddcf2566b7d8e6300015ed549c 1 parent 9eab01e
@ayende ayende authored
Showing with 7 additions and 7 deletions.
  1. +7 −7 Raven.Database/Storage/IndexDefinitionStorage.cs
View
14 Raven.Database/Storage/IndexDefinitionStorage.cs
@@ -129,7 +129,7 @@ public string AddIndex(IndexDefinition indexDefinition)
if (configuration.RunInMemory == false)
{
var encodeIndexNameIfNeeded = FixupIndexName(indexDefinition.Name, path);
- var indexName = Path.Combine(path, encodeIndexNameIfNeeded + ".index");
+ var indexName = Path.Combine(path, MonoHttpUtility.UrlEncode(encodeIndexNameIfNeeded) + ".index");
// Hash the name if it's too long (as a path)
File.WriteAllText(indexName, JsonConvert.SerializeObject(indexDefinition, Formatting.Indented, Default.Converters));
}
@@ -168,13 +168,13 @@ public void RemoveIndex(string name)
private string GetIndexSourcePath(string name)
{
var encodeIndexNameIfNeeded = FixupIndexName(name, path);
- return Path.Combine(path, encodeIndexNameIfNeeded + ".index.cs");
+ return Path.Combine(path, MonoHttpUtility.UrlEncode(encodeIndexNameIfNeeded) + ".index.cs");
}
private string GetIndexPath(string name)
{
var encodeIndexNameIfNeeded = FixupIndexName(name, path);
- return Path.Combine(path, encodeIndexNameIfNeeded + ".index");
+ return Path.Combine(path, MonoHttpUtility.UrlEncode(encodeIndexNameIfNeeded) + ".index");
}
public IndexDefinition GetIndexDefinition(string name)
@@ -224,15 +224,15 @@ public static string FixupIndexName(string index, string path)
}
var fixupIndexName = MonoHttpUtility.UrlEncode(index);
if (path.Length + fixupIndexName.Length > 230 ||
- Encoding.Unicode.GetByteCount(index) >= 255)
+ Encoding.Unicode.GetByteCount(fixupIndexName) >= 255)
{
using (var md5 = MD5.Create())
{
var bytes = md5.ComputeHash(Encoding.UTF8.GetBytes(index));
- return MonoHttpUtility.UrlEncode(prefix + Convert.ToBase64String(bytes));
+ return prefix + Convert.ToBase64String(bytes);
}
}
- return fixupIndexName;
+ return index;
}
public static void ResolveAnalyzers(IndexDefinition indexDefinition)
@@ -249,4 +249,4 @@ public static void ResolveAnalyzers(IndexDefinition indexDefinition)
}
}
}
-}
+}
Please sign in to comment.
Something went wrong with that request. Please try again.