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

Commit

Permalink
2003-09-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
Browse files Browse the repository at this point in the history
	* XSPWorkerRequest.cs: don't crash when no Host header is received or
	if it has an invalid port.

svn path=/trunk/xsp/; revision=18159
  • Loading branch information
gonzalop committed Sep 18, 2003
1 parent 8379a2a commit cfaf916
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
13 changes: 9 additions & 4 deletions server/ChangeLog
@@ -1,9 +1,14 @@
2003-09-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>

* XSPWorkerRequest.cs: don't crash when no Host header is received or
if it has an invalid port.

2003-09-04 Lluis Sanchez Gual <lluis@ximian.com>

* XSPWorkerRequest.cs: GetServerName(): reverted previous patch. There was
a conflict with previous changes.
Also modified implementation of GetLocalAddress(). It should get the value
from the request header.
* XSPWorkerRequest.cs: GetServerName(): reverted previous patch. There
was a conflict with previous changes.
Also modified implementation of GetLocalAddress(). It should get the
value from the request header.

2003-09-04 Lluis Sanchez Gual <lluis@ximian.com>

Expand Down
17 changes: 13 additions & 4 deletions server/XSPWorkerRequest.cs
Expand Up @@ -124,14 +124,23 @@ static void SetDefaultIndexFiles (string list)
response = new MemoryStream ();
status = "HTTP/1.0 200 OK\r\n";

int i = -1;
string url = GetKnownRequestHeader (HeaderHost);
int i = url.LastIndexOf (":");
if (url != null)
i = url.LastIndexOf (":");

if (i == -1) {
localPort = 80;
localAddress = url;
}
else {
localPort = int.Parse (url.Substring (i+1));
} else {
try {
localPort = int.Parse (url.Substring (i+1));
} catch {
// May be we should send a 50x error?

localPort = 80;
}

localAddress = url.Substring (0,i);
}
}
Expand Down

0 comments on commit cfaf916

Please sign in to comment.