Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Better handling on non IIS 7 integrated pipeline

  • Loading branch information...
commit 963a3208b543a7f27aaa6332aaac1ed96e59b972 1 parent e3be394
@ayende ayende authored
View
5 Raven.Client.MvcIntegration/RavenProfiler.cs
@@ -10,6 +10,11 @@ namespace Raven.Client.MvcIntegration
{
public class RavenProfiler
{
+ /// <summary>
+ /// Initializes the RavenProfiler for MVC
+ /// IMPORTANT! This method may only be called from the Application_Start method, otherwise
+ /// it might lead to problems, since it modify the Routes table.
+ /// </summary>
public static void InitializeFor(IDocumentStore store, params string[] fieldsToFilter)
{
var existing = RouteTable.Routes.Select(x =>
View
10 Raven.Client.MvcIntegration/RavenProfilingHandler.cs
@@ -7,7 +7,6 @@
using System.Web.Routing;
using Newtonsoft.Json;
using Raven.Abstractions;
-using Raven.Client.Connection.Profiling;
using Raven.Client.Document;
namespace Raven.Client.MvcIntegration
@@ -144,13 +143,10 @@ public void AddStore(IDocumentStore store)
private void OnSessionCreated(InMemoryDocumentSessionOperations operations)
{
RavenProfiler.ContextualSessionList.Add(operations.Id);
- if (HttpContext.Current != null && HttpContext.Current.Response != null) {
- string ids = HttpContext.Current.Response.Headers["X-RavenDb-Profiling-Id"] ?? "";
- ids = ids + (ids.Length == 0 ? "" : ",") + operations.Id.ToString();
- HttpContext.Current.Response.Headers.Set("X-RavenDb-Profiling-Id", ids);
+ if (HttpContext.Current != null)
+ {
+ HttpContext.Current.Response.AddHeader("X-RavenDb-Profiling-Id", operations.Id.ToString());
}
}
-
- private static string ravenDbProfilerScripts;
}
}
View
2  Raven.Client.MvcIntegration/ravendb-profiler-scripts.js
@@ -138,7 +138,7 @@ var RavenDBProfiler = (function ($) {
$('body').ajaxComplete(function (event, xhrRequest, ajaxOptions) {
var id = xhrRequest.getResponseHeader('X-RavenDb-Profiling-Id');
if (id)
- fetchResults(id.split(','));
+ fetchResults(id.split(', '));
});
load();
}
Please sign in to comment.
Something went wrong with that request. Please try again.