Response.Redirect() is dealing an Absolute URL as an relative URL
I have a .net C# page that redirects to an absolute url, eg:
Response.Redirect("rtsp://myvideoServer.com/myVideoAddress.mp4?ticket=1234&dt=1234");
But after the redirecting it results in:
"ht开发者_运维知识库tp://m.mysite.com/rtsp://myvideoServer.com/myVideoAddress.mp4?ticket=1234&dt=1234"
It works fine if I write the url to an HTML page and click the address. But the redirection does that mess.
The most weird is that it worked before last version.
Do you have any ideas? I'm almost doing a workaround to solve that.
Response.StatusCode = 301;
Response.AddHeader("location","rtsp://myvideoServer.com/myVideoAddress.mp4?ticket=1234&dt=1234");
Response.End();
EDIT is not working with browsers
I don't think a browser understands the rtsp protocol (in the meaning of doing e GET request in other way than from an embedded object), but if you have a client which understands this redirect, this should work.
I would suggest doing a workaround.
Use Response.AddHeader instead. It looks like Response.Redirect isn't recognizing rtsp:// as a protocol, and is treating it as a relative path.
Response.AddHeader("Location","rtsp://myvideoServer.com/myVideoAddress.mp4?ticket=1234&dt=1234");
精彩评论