Skip to content
This repository has been archived by the owner on Nov 19, 2022. It is now read-only.

Commit

Permalink
[xsp] Fix for bug #2774. RawUrl shall really be raw.
Browse files Browse the repository at this point in the history
  • Loading branch information
grendello committed Jan 10, 2012
1 parent a641207 commit edb5d4e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
15 changes: 7 additions & 8 deletions src/Mono.WebServer.Apache/ModMonoWorkerRequest.cs
Expand Up @@ -4,11 +4,13 @@
// Authors: // Authors:
// Daniel Lopez Ridruejo // Daniel Lopez Ridruejo
// Gonzalo Paniagua Javier // Gonzalo Paniagua Javier
// Marek Habersack <grendel@twistedcode.net>
// //
// Copyright (c) 2002 Daniel Lopez Ridruejo. // Copyright (c) 2002 Daniel Lopez Ridruejo.
// (c) 2002,2003 Ximian, Inc. // (c) 2002,2003 Ximian, Inc.
// All rights reserved. // All rights reserved.
// (C) Copyright 2004-2008 Novell, Inc. (http://www.novell.com) // (C) Copyright 2004-2008 Novell, Inc. (http://www.novell.com)
// Copyright 2012 Xamarin, Inc (http://xamarin.com)
// //
// Permission is hereby granted, free of charge, to any person obtaining // Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the // a copy of this software and associated documentation files (the
Expand Down Expand Up @@ -52,6 +54,7 @@ public class ModMonoWorkerRequest : MonoWorkerRequest
string protocol; string protocol;
string path; string path;
string pathInfo; string pathInfo;
string rawUrl;
string localAddress; string localAddress;
int serverPort; int serverPort;
string remoteAddress; string remoteAddress;
Expand Down Expand Up @@ -137,6 +140,9 @@ static void SetDefaultIndexFiles (string list)
this.requestBroker = requestBroker; this.requestBroker = requestBroker;
this.verb = verb; this.verb = verb;
this.appHost = appHost; this.appHost = appHost;
this.rawUrl = path;
if (!String.IsNullOrEmpty (queryString))
this.rawUrl += "?" + queryString;
//this.protocol = protocol; //this.protocol = protocol;
// Don't let System.Web know if it's 1.1. This way apache handles the chunked // Don't let System.Web know if it's 1.1. This way apache handles the chunked
// encoding for us, without sys.web interfering. // encoding for us, without sys.web interfering.
Expand Down Expand Up @@ -174,14 +180,7 @@ public override string GetPathInfo ()


public override string GetRawUrl () public override string GetRawUrl ()
{ {
string result = path; return rawUrl;
if (pathInfo != null && pathInfo.Length > 0)
result += pathInfo;

if (queryString != null && queryString.Length > 0)
return result + "?" + queryString;

return result;
} }


bool TryDirectory () bool TryDirectory ()
Expand Down
15 changes: 7 additions & 8 deletions src/Mono.WebServer.XSP/XSPWorkerRequest.cs
Expand Up @@ -4,9 +4,11 @@
// Authors: // Authors:
// Gonzalo Paniagua Javier (gonzalo@ximian.com) // Gonzalo Paniagua Javier (gonzalo@ximian.com)
// Simon Waite (simon@psionics.demon.co.uk) // Simon Waite (simon@psionics.demon.co.uk)
// Marek Habersack (grendel@twistedcode.net)
// //
// (C) 2002,2003 Ximian, Inc (http://www.ximian.com) // (C) 2002,2003 Ximian, Inc (http://www.ximian.com)
// (C) Copyright 2004-2005 Novell, Inc. (http://www.novell.com) // (C) Copyright 2004-2005 Novell, Inc. (http://www.novell.com)
// Copyright 2012 Xamarin, Inc (http://xamarin.com)
// //
// Permission is hereby granted, free of charge, to any person obtaining // Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the // a copy of this software and associated documentation files (the
Expand Down Expand Up @@ -51,6 +53,7 @@ public class XSPWorkerRequest : MonoWorkerRequest
{ {
string verb; string verb;
string path; string path;
string rawUrl;
string pathInfo; string pathInfo;
string queryString; string queryString;
string protocol; string protocol;
Expand Down Expand Up @@ -174,6 +177,9 @@ static void SetDefaultIndexFiles (string list)
this.requestBroker = requestBroker; this.requestBroker = requestBroker;
this.remoteEP = remoteEP; this.remoteEP = remoteEP;
this.verb = verb; this.verb = verb;
this.rawUrl = path;
if (!String.IsNullOrEmpty (queryString))
this.rawUrl += "?" + queryString;
try { try {
Paths.GetPathsFromUri (appHost, verb, path, out this.path, out pathInfo); Paths.GetPathsFromUri (appHost, verb, path, out this.path, out pathInfo);
} catch { } catch {
Expand Down Expand Up @@ -508,14 +514,7 @@ public override string GetQueryString ()


public override string GetRawUrl () public override string GetRawUrl ()
{ {
string result = path; return rawUrl;
if (pathInfo != null && pathInfo.Length > 0)
result += pathInfo;

if (queryString != null && queryString.Length > 0)
return result + "?" + queryString;

return result;
} }


public override string GetRemoteAddress () public override string GetRemoteAddress ()
Expand Down

0 comments on commit edb5d4e

Please sign in to comment.