Skip to content

Fix redirection of SF bugs #2110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 9, 2022
Merged

Conversation

serhiy-storchaka
Copy link
Member

Fixes #2109.

@ewdurbin
Copy link
Member

ewdurbin commented Aug 9, 2022

Confirmed the old legacy cgi-bin was doing same thing:

From Apache config:

    ScriptAlias /sf /data/cgi-bin/sf

And the script:

#!/usr/bin/python
# This file is in RCS
import os, httplib, sys, cgitb, time

def num():
    try:
        return int(os.environ['PATH_INFO'][1:])
    except (KeyError, ValueError, TypeError):
        try:
            import cgi
            return int(cgi.FieldStorage().getvalue("id"))
        except (ValueError, TypeError):
            return None

def bad_request(msg):
    print "Content-type: text/html"
    print ""
    print "<html><title>Invalid report</title>"
    print "<body>"+msg+"</body></html>"
    raise SystemExit

report = num()
if not report:
    bad_request("You did not provide a report number")

location = "http://bugs.python.org/issue%s" % report
print "Location: "+location+"\n"

@ewdurbin ewdurbin merged commit 6bd101d into python:main Aug 9, 2022
@serhiy-storchaka serhiy-storchaka deleted the redirect-sf-bugs branch August 9, 2022 18:55
@serhiy-storchaka
Copy link
Member Author

Thank you. I was not sure about the existing location block, it handled paths with /sf not followed by a slash, and query parameters (e.g. /sfoo, /sf?bar=baz, /sfoo?bar=baz). I did not have any idea what use cases it supported. But seems it was just too general, the path should always start with /sf/ and no query parameters are used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Links like http://python.org/sf/1541697 no longer work
2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy