ASP.Net:HTTP试图处理HTTP时,400错误请求错误://本地主机:5957 / HTTP://yahoo.com [英] ASP.Net: HTTP 400 Bad Request error when trying to process http://localhost:5957/http://yahoo.com
问题描述
我试图创建一个类似于diggbar东西: http://digg.com/ http://cnn.com
I'm trying to create something similar to the diggbar : http://digg.com/http://cnn.com
我使用Visual Studio 2010和ASP开发服务器。
I'm using Visual Studio 2010 and Asp Development server.
不过,我不能让ASP开发服务器,因为它包含处理请求的http:路径。我试图创建一个HttpModule改写了的BeginRequest的网址,但该事件处理程序不会被调用当网址的 HTTP://本地主机:5957 / HTTP://yahoo.com 。该事件处理函数被调用如果URL 的http://本地主机:5957 / HTTP / yahoo.com 一>
However, I can't get the ASP dev server to handle the request because it contains "http:" in the path. I've tried to create an HTTPModule to rewrite the URL in the BeginRequest , but the event handler doesn't get called when the url is http://localhost:5957/http://yahoo.com. The event handler does get called if the url is http://localhost:5957/http/yahoo.com
要总结
- 的http://本地主机:5957 / HTTP / yahoo.com 作品
- 的http://本地主机:5957 / HTTP // yahoo.com 不起作用
- 的http://本地主机:5957 / HTTP://yahoo.com 呢不行
- 的http://本地主机:5957 / HTTP:/yahoo.com 不起作用
- http://localhost:5957/http/yahoo.com works
- http://localhost:5957/http//yahoo.com does not work
- http://localhost:5957/http://yahoo.com does not work
- http://localhost:5957/http:/yahoo.com does not work
任何想法?
推荐答案
我已经写了斯特凡的帮助下一篇文章,解释如何做到这一点:
I've written an article with Stefan's help that explains how to do this:
<一个href=\"http://www.hanselman.com/blog/ExperimentsInWackinessAllowingPercentsAnglebracketsAndOtherNaughtyThingsInTheASPNETIISRequestURL.aspx\">Experiments在的古怪:允许百分比,尖括号,并在ASP.NET/IIS请求网址其他顽皮的事情
这篇关于ASP.Net:HTTP试图处理HTTP时,400错误请求错误://本地主机:5957 / HTTP://yahoo.com的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!