[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 597
  • Last Modified:

IE7 inserting space in address bar before domain in URL

I have customers using IE7 that are trying to go to
http://norwood.com/default.jsp . The purpose of this default.jsp page is to
redirect people to the correct url based on the domain name in the address
bar. When I do the following in the JSP code it returns " norwood.com".
I've only seen this for IE7 and it never happens with other browsers such as
IE5, IE6 or any Mozilla browser. Is there some bug in IE7 for HTTP request
headers ?

String var_server = request.getServerName().toLowerCase();
0
f0rdmstang
Asked:
f0rdmstang
  • 2
1 Solution
 
m00003643Commented:
Depending on your development environment, you should try running it in debug mode to make sure there's no extra spaces in the server name property.

You could also try trimming the string:
String var_server = request.getServerName().toLowerCase().trim();

0
 
f0rdmstangAuthor Commented:
I've found the issue to be that IE7 in this case is inserting an extra space after the "Host: " header.  It seems that using the trim() function is a great workaround for my issue.
0
 
m00003643Commented:
Are you sure IE7 was adding the space to the header, or was it simply not able to parse the header with a space like the other browsers could?
Otherwise I'm not sure how trimming the spaces on the server side would fix an IE problem on the client side...

Either way, I'm glad the solution worked for you...
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now