#19122: wxHTTP,wxURL,wxFileSystem and HTTP/3xx/Redirect
----------------------+-------------------
Reporter: brambor | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: network | Version: 3.1.4
Resolution: | Keywords:
Blocked By: | Blocking:
Patch: 1 |
----------------------+-------------------
Changes (by brambor):
* cc: borsky@… (added)
Comment:
Let me disagree on that one. A little context is this: some time ago a
client moved some windows share to linux http server (apache). That made
all urls case sensitive ones, breaking lots of links.
There is a simple way to make apache case insensitive with module named
mod_speling. It works by redirecting case-wrong url request to correct
one. And all is good again.
The important part is this: it worked fine with wx2.8 with existing wxHTTP
using native WinNet implementation under Windows. And it breaks
spectaculary under linux. Looks like WinNet will do redirects for us
transparently under the hood.
My proposed patch makes linux port behave similar to windows here without
any need to modify existing code outside wxURL. Side effect is that wxURL
will then point to redirected URL, but only under linux.
Your proposal will leave wxURL::GetInputStream() inconsistent between
platforms. It will load either redirected stream with correct data when
using WinNet or load redirect error message stream under linux. For one,
this will lead to porting/testing problems for any app that make use of
wxURL outside wxFileSystem.
Maybe wxURL::GetInputStream() should return error like HTTP_REDIRECT and
null stream, but then again, we can't do that at least with WinNet.
--
Ticket URL: <
https://trac.wxwidgets.org/ticket/19122#comment:4>