From 8e6eefbc04fa955d76da48018118f62604f54680 Mon Sep 17 00:00:00 2001 From: Greg Edwards Date: Wed, 10 Sep 2014 16:32:35 -0400 Subject: [PATCH] Obtain the request path in a way that doesn't depend on my URL rewrite scheme. --- GamestatsBase/GamestatsHandler.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/GamestatsBase/GamestatsHandler.cs b/GamestatsBase/GamestatsHandler.cs index fb84400..921d0ff 100644 --- a/GamestatsBase/GamestatsHandler.cs +++ b/GamestatsBase/GamestatsHandler.cs @@ -71,10 +71,15 @@ namespace GamestatsBase return; } + String rawPath = context.Request.RawUrl; + int qmPos = rawPath.IndexOf('?'); + if (qmPos >= 0) + rawPath = rawPath.Substring(0, qmPos); + if (context.Request.QueryString.Count == 1) { // this is a new session request - GamestatsSession session = CreateSession(pid, context.Request.PathInfo); + GamestatsSession session = CreateSession(pid, rawPath); GamestatsSessionManager manager = GamestatsSessionManager.FromContext(context); manager.Add(session); @@ -171,7 +176,7 @@ namespace GamestatsBase MemoryStream response = new MemoryStream(); try { - ProcessGamestatsRequest(dataTrim, response, context.Request.PathInfo, pid, context); + ProcessGamestatsRequest(dataTrim, response, rawPath, pid, context); } catch (GamestatsException ex) {