Search

HttpListenerContext.Request.IsLocal uses '==' instead of '.Equals' to see if local address is the same as the remote address by dmehers

Closed
as Fixed Help for as Fixed

2
Sign in to vote
0
Sign in to vote
Sign in
to vote
Type: Bug
ID: 331513
Opened: 3/5/2008 12:52:05 AM
Access Restriction: Public
1
Workaround(s)
0
User(s) can reproduce this bug
HttpListenerContext.Request.IsLocal is returning false even though the caller is on the same machine as the server. I think that this may be because 'IsLocal' is implemented by the framework as:
public bool get_IsLocal()
{
    return (this.LocalEndPoint.Address == this.RemoteEndPoint.Address);
}

I think it should perhaps be:
public bool get_IsLocal()
{
    return (this.LocalEndPoint.Address.Equals(this.RemoteEndPoint.Address));
}


Not sure that it is relevant, but here is my IPCONFIG:
Windows IP Configuration


Ethernet adapter Local Area Connection:

Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::ad88:486e:2b75:be03%8
IPv4 Address. . . . . . . . . . . : 192.168.1.5
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1

Tunnel adapter Local Area Connection* 6:

Connection-specific DNS Suffix . :
IPv6 Address. . . . . . . . . . . : 2001:0:4137:9e66:1824:3763:3f57:fefa
Link-local IPv6 Address . . . . . : fe80::1824:3763:3f57:fefa%9
Default Gateway . . . . . . . . . : ::

Tunnel adapter Local Area Connection* 7:

Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::5efe:192.168.1.5%11
Default Gateway . . . . . . . . . :
Details (expand)
Product Language
English

Version

.NET Framework 2.0
Operating System
Windows Vista
Operating System Language
English
Steps to Reproduce
Accept a connection on an HttpListener from a local caller and then call "IsLocal" on the resulting HttpListenerContext.Request
Actual Results
false
Expected Results
true
TAP Code (if applicable)
 
      You can indicate your satisfaction with how Microsoft handled this issue by completing this quick 3 question survey. [Details]

 

File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 3/6/2008 at 1:47 AM
Thank you for your feedback. We are currently investigating. The investigation process normally takes 7-14 days. If this issue is urgent, please contact support directly (see http://support.microsoft.com).

If at any time your issue is closed unsatisfactorily, you may edit your issue via Connect and change the status to “Active.”

Thank you,
Visual Studio Product Team
Posted by Microsoft on 3/9/2008 at 12:48 AM
Thanks for your feedback.

We are escalating this issue to the appropriate group within the Visual Studio Product Team for triage and resolution.
These specialized experts will follow-up with your issue.

Thank you,
Visual Studio Product Team
Posted by Microsoft on 2/9/2009 at 3:12 PM
Hello,

Thanks for reporting the bug. This bug has been fixed and the fix will be available as part of .NET Framework 4.0.


Thanks You,
NCL Team