Author oulenz
Recipients oulenz
Date 2018-03-29.16:08:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
SimpleHTTPRequestHandler.send_head() has this bit:

        if os.path.isdir(path):
            parts = urllib.parse.urlsplit(self.path)
            if not parts.path.endswith('/'):
                # redirect browser - doing basically what apache does

I think there are two issues here:
1) why should the server return a redirect code here, and not (in the code that immediately follows) when it serves an index file?
2) code 301 (permanent redirect) is really unforgiving, browsers like Firefox and Chrome will permanently cache the redirect, making it essentially impossible to undo if you do not control the client, and not trivial even if you do. This will probably not change on the browser-side, general opinion seems to be that limited caching should either be specified in the response header or that a different redirect code should be sent back.

Therefore I would like to propose that preferably,
- no redirect code be sent back, or else that
- a different redirect code be sent back, or else that
- no-caching or a time limit be added to the header

(This may require that send_head check for index files instead)
Date User Action Args
2018-03-29 16:08:41oulenzsetrecipients: + oulenz
2018-03-29 16:08:41oulenzsetmessageid: <>
2018-03-29 16:08:41oulenzlinkissue33181 messages
2018-03-29 16:08:41oulenzcreate