Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 577805 Details for
Bug 813061
DIY Application content is being overridden for 4xx status codes
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
status 400 python sample
status400.py (text/x-python-script), 1.04 KB, created by
Ram Ranganathan
on 2012-04-16 18:57:19 UTC
(
hide
)
Description:
status 400 python sample
Filename:
MIME Type:
Creator:
Ram Ranganathan
Created:
2012-04-16 18:57:19 UTC
Size:
1.04 KB
patch
obsolete
>#!/usr/bin/env python > >import os >import time >import BaseHTTPServer > >HOST_NAME = os.getenv("OPENSHIFT_INTERNAL_IP") >PORT_NUMBER = 8080 > >class MyHandler(BaseHTTPServer.BaseHTTPRequestHandler): > def do_HEAD(s): > s.send_response(200) > s.send_header("Content-type", "text/html") > s.end_headers() > def do_GET(s): > """Respond to a GET request.""" > s.send_response(400) > s.send_header("Content-type", "text/html") > s.end_headers() > s.wfile.write("<html>\n") > s.wfile.write("<head><title>void *status400;</title></head>\n") > s.wfile.write("<body><br/><h3>Custom 400 status code page</h3></body>\n"); > s.wfile.write("</html>\n"); > >if __name__ == '__main__': > server_class = BaseHTTPServer.HTTPServer > httpd = server_class((HOST_NAME, PORT_NUMBER), MyHandler) > print time.asctime(), "Server Starts - %s:%s" % (HOST_NAME, PORT_NUMBER) > try: > httpd.serve_forever() > except KeyboardInterrupt: > pass > httpd.server_close() > print time.asctime(), "Server Stops - %s:%s" % (HOST_NAME, PORT_NUMBER)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 813061
: 577805