Skip to content

Commit

Permalink
fix #20
Browse files Browse the repository at this point in the history
  • Loading branch information
pofider committed Nov 10, 2016
1 parent f709c5f commit 8e16728
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 21 deletions.
20 changes: 1 addition & 19 deletions jsreport/jsreport.Client/JsReportWebHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ public void ProcessRequest(HttpContext context)
if (ReportingService == null)
throw new InvalidOperationException("Missing ReportingService on JsReportWebHandler");

var url = CreateRequestUrl(context);

var request =
(HttpWebRequest)WebRequest.Create(ReportingService.ServiceUri.ToString().TrimEnd('/') + context.Request.Url.PathAndQuery.Replace("/jsreport.axd", ""));
request.Method = context.Request.HttpMethod;
Expand All @@ -47,22 +45,6 @@ public void ProcessRequest(HttpContext context)
}
}

private static string CreateRequestUrl(HttpContext context)
{
string url = context.Request.QueryString["url"] ?? "/";

if (url.Contains("?"))
url += "&";
else
url += "?";

if (!url.EndsWith("&"))
url += "&";

url += "serverUrl=" + context.Server.UrlEncode(context.Request.Url.GetLeftPart(UriPartial.Authority) + "/jsreport.axd?url=/");
return url;
}

private static void ParseRequestHeaders(HttpContext context, HttpWebRequest request)
{
foreach (string header in context.Request.Headers.AllKeys)
Expand Down Expand Up @@ -124,7 +106,7 @@ private static void ProcessResponse(HttpContext context, HttpWebResponse respons

context.Response.StatusCode = (int)responseMerge.StatusCode;

if (context.Request.Path == "/jsreport.axd")
if (context.Request.Path == "/jsreport.axd" || context.Request.Path == "/jsreport.axd/")
{
using (var reader = new StreamReader(responseMerge.GetResponseStream()))
{
Expand Down
4 changes: 2 additions & 2 deletions jsreport/jsreport.Client/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.1.0")]
[assembly: AssemblyFileVersion("1.0.1.0")]
[assembly: AssemblyVersion("1.0.3.0")]
[assembly: AssemblyFileVersion("1.0.3.0")]

0 comments on commit 8e16728

Please sign in to comment.