Groups > Asp .Net > HttpHandlers and HttpModules > Re: Issue with HttpHandler - Bad Request with path containing '&' or '%' character




Issue with HttpHandler - Bad Request with path containing
'&' or '%' character

Issue with HttpHandler - Bad Request with path containing '&' or '%' character
Sat, 23 Feb 2008 02:14:51 +000
Hello,

I am using HttpHandler to handle request for documents (.doc, .pdf, .xls, etc).
I receive "Bad Request" message from .Net when the URL contains
character '&' or '%'. 

For example, "http://www.mysite.com/docs/test.doc" works fine on my
HttpHandler, but "http://www.mysite.com/docs/test&file.doc"
returns "Bad Request" message. It seems this issue caused by .Net
Framework itself instead of my coding. I found the following article
http://support.microsoft.com/kb/826437, but it doesn't fix my problem because I
am using .Net Framework 3.5 and Visual Studio 2008. 



Any suggestion on this issue? Is there a configuration to force .Net to accept
URL path with '&' or '%'.

Thank you.
Post Reply
Re: Issue with HttpHandler - Bad Request with path containing '&' or '%' character
Sat, 23 Feb 2008 04:22:38 +000
URL encode your URL. The & is a quesrystring delimiter, so you should have
issues with that.
Post Reply
Re: Issue with HttpHandler - Bad Request with path containing '&' or '%' character
Mon, 25 Feb 2008 17:10:27 +000
URL encode will not work with '%' character.

 For example, URL like "http://mysite.com/test%25character.doc" will
not work.


 Any more suggestion? Thanks.
Post Reply
Re: Issue with HttpHandler - Bad Request with path containing '&' or '%' character
Thu, 28 Feb 2008 10:21:34 +000
fumma:

 URL encode will not work with '%' character.

 For example, URL like "http://mysite.com/test%25character.doc" will
not work.


 Any more suggestion? Thanks.
  

This  should be encoded format so there is no effect to encoded it anymore.
Post Reply
about | contact