summaryrefslogtreecommitdiffstats
path: root/Lib/http
Commit message (Collapse)AuthorAgeFilesLines
* [3.4] bpo-35121: prefix dot in domain for proper subdomain validation ↵Xtreak2019-03-161-2/+11
| | | | | | | | (GH-10258) (#12279) Don't send cookies of domain A without Domain attribute to domain B when domain A is a suffix match of domain B while using a cookiejar with `http.cookiejar.DefaultCookiePolicy` policy. Patch by Karthikeyan Singaravelan. (cherry picked from commit ca7fe5063593958e5efdf90f068582837f07bd14) Co-authored-by: Xtreak <tir.karthi@gmail.com>
* bpo-35647: Fix path check in cookiejar (#11436) (#12278)Xtreak2019-03-161-5/+9
| | | | | | | | | | | | | * Refactor cookie path check as per RFC 6265 * Add tests for prefix match of path * Add news entry * Fix set_ok_path and refactor tests * Use slice for last letter (cherry picked from commit 0e1f1f01058bd4a9b98cfe443214adecc019a38c)
* bpo-26657: Fix Windows directory traversal vulnerability with http.server (#782)Victor Stinner2017-07-121-3/+3
| | | | | | Based on patch by Philipp Hagemeister. This fixes a regression caused by revision f4377699fd47. (cherry picked from commit d274b3f1f1e2d8811733fb952c9f18d7da3a376a)
* Correct Content-Type syntax in documentationMartin Panter2015-11-141-4/+4
|
* Issue #25523: Further a-to-an corrections.Serhiy Storchaka2015-11-021-1/+1
|
* Various minor typos in documentation and commentsMartin Panter2015-10-071-1/+1
|
* Issue #24657: Prevent CGIRequestHandler from collapsing the URL queryMartin Panter2015-10-031-4/+9
| | | | | Initial patch from Xiang Zhang. Also fix out-of-date _url_collapse_path() doc string.
* Issue #25232: Fix CGIRequestHandler's splitting of URL queryMartin Panter2015-10-031-5/+1
| | | | Patch from Xiang Zhang.
* Issue #24774: Fix docstring in http.server.test.Robert Collins2015-08-171-2/+1
| | | | Patch from Chiu-Hsiang Hsu.
* Issue #23888: Handle fractional time in cookie expiry. Patch by ssh.Robert Collins2015-08-031-1/+1
|
* merge 3.3 (#22931)Benjamin Peterson2015-05-231-3/+4
|\
| * merge 3.2 (#22931)Benjamin Peterson2015-05-231-3/+4
| |\
| | * allow square brackets in cookie values (closes #22931)Benjamin Peterson2015-05-231-3/+4
| | |
| | * Lax cookie parsing in http.cookies could be a security issue when combinedAntoine Pitrou2014-09-161-1/+2
| | | | | | | | | | | | | | | | | | with non-standard cookie handling in some Web browsers. Reported by Sergey Bobrov.
| | * Issue #16037: HTTPMessage.readheaders() raises an HTTPException when more thanGeorg Brandl2014-09-301-0/+4
| | | | | | | | | | | | 100 headers are read. Adapted from patch by Jyrki Pulliainen.
* | | Issue #23865: close() methods in multiple modules now are idempotent and moreSerhiy Storchaka2015-04-101-9/+15
| | | | | | | | | | | | | | | robust at shutdown. If needs to release multiple resources, they are released even if errors are occured.
* | | #23539: Set Content-Length to 0 for PUT, POST, and PATCH if body is None.R David Murray2015-03-221-13/+24
| | | | | | | | | | | | | | | | | | | | | | | | Some http servers will reject PUT, POST, and PATCH requests if they do not have a Content-Length header. Patch by James Rutherford, with additional cleaning up of the 'request' documentation by me.
* | | Issue #23138: Fixed parsing cookies with absent keys or values in cookiejar.Serhiy Storchaka2015-03-131-15/+31
| | | | | | | | | | | | Patch by Demian Brecht.
* | | Issue #22928: Disabled HTTP header injections in http.client.Serhiy Storchaka2015-03-121-0/+37
| | | | | | | | | | | | Original patch by Demian Brecht.
* | | Issue #23439: Add missing entries to http.client.__all__.Berker Peksag2015-02-201-1/+3
| | | | | | | | | | | | | | | | | | | | | Also, document the LineTooLong exception since it can be raised by the members of public API (e.g. http.client.HTTPResponse). Patch by Martin Panter.
* | | document the requestline and close_connection attributes, use real booleans, ↵Benjamin Peterson2015-02-181-10/+10
| | | | | | | | | | | | | | | | | | and add tests (closes #23410) Patch by Martin Panter.
* | | Issue #23418: Add missing entries to http.server.__all__.Berker Peksag2015-02-131-1/+4
| | | | | | | | | | | | Patch by Martin Panter.
* | | capitialize "HttpOnly" and "Secure" as they appear in the standard and other ↵Benjamin Peterson2015-01-171-2/+2
| | | | | | | | | | | | | | | | | | impls (closes #23250) Patch by Jon Dufresne.
* | | fix instances of consecutive articles (closes #23221)Benjamin Peterson2015-01-131-1/+1
| | | | | | | | | | | | Patch by Karan Goel.
* | | fix behavior of trailing slash redirection when a query string is involved ↵Benjamin Peterson2014-12-261-2/+6
| | | | | | | | | | | | (closes #23112)
* | | Issue #22095: Fixed HTTPConnection.set_tunnel with default port. The portSerhiy Storchaka2014-12-121-5/+3
| | | | | | | | | | | | value in the host header was set to "None". Patch by Demian Brecht.
* | | HTTPSConnection: prefer the context's check_hostname attribute over the ↵Benjamin Peterson2014-12-071-2/+2
| | | | | | | | | | | | constructor parameter (#22959)
* | | Issue #21032. Fixed socket leak if HTTPConnection.getresponse() fails.Serhiy Storchaka2014-12-011-10/+14
| | | | | | | | | | | | Original patch by Martin Panter.
* | | don't require OpenSSL SNI to pass hostname to ssl functions (#22921)Benjamin Peterson2014-11-231-2/+1
| | | | | | | | | | | | Patch by Donald Stufft.
* | | PEP 476: enable HTTPS certificate verification by default (#22417)Benjamin Peterson2014-11-031-1/+1
| | | | | | | | | | | | Patch by Alex Gaynor with some modifications by me.
* | | Issue #22775: Fixed unpickling of http.cookies.SimpleCookie with protocol 2Serhiy Storchaka2014-11-021-2/+6
| | | | | | | | | | | | and above. Patch by Tim Graham.
* | | Lax cookie parsing in http.cookies could be a security issue when combinedAntoine Pitrou2014-09-161-1/+2
|\ \ \ | |/ / | | | | | | | | | | | | with non-standard cookie handling in some Web browsers. Reported by Sergey Bobrov.
| * | Lax cookie parsing in http.cookies could be a security issue when combinedAntoine Pitrou2014-09-161-1/+2
| | | | | | | | | | | | | | | | | | with non-standard cookie handling in some Web browsers. Reported by Sergey Bobrov.
* | | Issue #22165: SimpleHTTPRequestHandler now supports undecodable file names.Serhiy Storchaka2014-08-171-4/+15
| | |
* | | Fixed bugs in reprs of CookieJar and multiprocessing.dummy.Value.Serhiy Storchaka2014-07-221-2/+2
| | |
* | | Issue #21323: Fix http.server to again handle scripts in CGI subdirectories,Ned Deily2014-07-131-5/+5
|\ \ \ | |/ / | | | | | | broken by the fix for security issue #19435. Patch by Zach Byrne.
| * | Issue #21323: Fix http.server to again handle scripts in CGI subdirectories,Ned Deily2014-07-131-5/+5
| |\ \ | | |/ | | | | | | broken by the fix for security issue #19435. Patch by Zach Byrne.
| | * Issue #21323: Fix http.server to again handle scripts in CGI subdirectories,Ned Deily2014-07-131-5/+5
| | | | | | | | | | | | broken by the fix for security issue #19435. Patch by Zach Byrne.
* | | merge 3.3 (#21766)Benjamin Peterson2014-06-151-1/+1
|\ \ \ | |/ /
| * | merge 3.2 (#21766)Benjamin Peterson2014-06-151-1/+1
| |\ \ | | |/
| | * url unquote the path before checking if it refers to a CGI script (closes ↵Benjamin Peterson2014-06-151-1/+1
| | | | | | | | | | | | #21766)
* | | Issue #7776: Fix ``Host:'' header and reconnection when using ↵Senthil Kumaran2014-04-141-24/+49
| | | | | | | | | | | | | | | | | | http.client.HTTPConnection.set_tunnel(). Patch by Nikolaus Rath.
* | | Issue #20976: pyflakes: Remove unused importsVictor Stinner2014-03-202-3/+0
| | |
* | | Issue #20331: Fixed possible FD leaks in various modules:Serhiy Storchaka2014-01-251-9/+15
|\ \ \ | |/ / | | | | | | http.server, imghdr, mailcap, mimetypes, xml.etree.
| * | Issue #20331: Fixed possible FD leaks in various modules:Serhiy Storchaka2014-01-251-9/+15
| | | | | | | | | | | | http.server, imghdr, mailcap, mimetypes, xml.etree.
* | | merge 3.3 (#18574)Benjamin Peterson2014-01-191-1/+1
|\ \ \ | |/ /
| * | fix handling of 100-continue status code (closes #18574)Benjamin Peterson2014-01-191-1/+1
| | |
* | | Issue #19936: Added executable bits or shebang lines to Python scripts whichSerhiy Storchaka2014-01-161-3/+0
|\ \ \ | |/ / | | | | | | | | | | | | | | | requires them. Disable executable bits and shebang lines in test and benchmark files in order to prevent using a random system python, and in source files of modules which don't provide command line interface. Fixed shebang lines in the unittestgui and checkpip scripts.
| * | Issue #19936: Added executable bits or shebang lines to Python scripts whichSerhiy Storchaka2014-01-161-3/+0
| | | | | | | | | | | | | | | | | | | | | requires them. Disable executable bits and shebang lines in test and benchmark files in order to prevent using a random system python, and in source files of modules which don't provide command line interface. Fixed shebang line to use python3 executable in the unittestgui script.
* | | merge 3.3 (#20018)Benjamin Peterson2013-12-181-1/+1
|\ \ \ | |/ /
an class="hl kwd">_ANSI_ARGS_(TCL_VARARGS(char *,format)) = NULL; /* *---------------------------------------------------------------------- * * Tcl_SetPanicProc -- * * Replace the default panic behavior with the specified functiion. * * Results: * None. * * Side effects: * Sets the panicProc variable. * *---------------------------------------------------------------------- */ void Tcl_SetPanicProc(proc) void (*proc) _ANSI_ARGS_(TCL_VARARGS(char *,format)); { panicProc = proc; } /* *---------------------------------------------------------------------- * * MacPanic -- * * Displays panic info.. * * Results: * None. * * Side effects: * Sets the panicProc variable. * *---------------------------------------------------------------------- */ static void MacPanic( char *msg) /* Text to show in panic dialog. */ { WindowRef macWinPtr, foundWinPtr; Rect macRect; Rect buttonRect = PANIC_BUTTON_RECT; Rect iconRect = PANIC_ICON_RECT; Rect textRect = PANIC_TEXT_RECT; ControlHandle okButtonHandle; EventRecord event; Handle stopIconHandle; int part; Boolean done = false; /* * Put up an alert without using the Resource Manager (there may * be no resources to load). Use the Window and Control Managers instead. * We want the window centered on the main monitor. The following * should be tested with multiple monitors. Look and see if there is a way * not using qd.screenBits. */ macRect.top = (qd.screenBits.bounds.top + qd.screenBits.bounds.bottom) / 2 - (PANICHEIGHT / 2); macRect.bottom = (qd.screenBits.bounds.top + qd.screenBits.bounds.bottom) / 2 + (PANICHEIGHT / 2); macRect.left = (qd.screenBits.bounds.left + qd.screenBits.bounds.right) / 2 - (PANICWIDTH / 2); macRect.right = (qd.screenBits.bounds.left + qd.screenBits.bounds.right) / 2 + (PANICWIDTH / 2); macWinPtr = NewWindow(NULL, &macRect, "\p", true, dBoxProc, (WindowRef) -1, false, 0); if (macWinPtr == NULL) { goto exitNow; } okButtonHandle = NewControl(macWinPtr, &buttonRect, "\pOK", true, 0, 0, 1, pushButProc, 0); if (okButtonHandle == NULL) { CloseWindow(macWinPtr); goto exitNow; } SelectWindow(macWinPtr); SetCursor(&qd.arrow); stopIconHandle = GetIcon(kStopIcon); while (!done) { if (WaitNextEvent(mDownMask | keyDownMask | updateMask, &event, 0, NULL)) { switch(event.what) { case mouseDown: part = FindWindow(event.where, &foundWinPtr); if ((foundWinPtr != macWinPtr) || (part != inContent)) { SysBeep(1); } else { SetPortWindowPort(macWinPtr); GlobalToLocal(&event.where); part = FindControl(event.where, macWinPtr, &okButtonHandle); if ((inButton == part) && (TrackControl(okButtonHandle, event.where, NULL))) { done = true; } } break; case keyDown: switch (event.message & charCodeMask) { case ENTERCODE: case RETURNCODE: HiliteControl(okButtonHandle, 1); HiliteControl(okButtonHandle, 0); done = true; } break; case updateEvt: SetPortWindowPort(macWinPtr); TextFont(systemFont); BeginUpdate(macWinPtr); if (stopIconHandle != NULL) { PlotIcon(&iconRect, stopIconHandle); } TextBox(msg, strlen(msg), &textRect, teFlushDefault); DrawControls(macWinPtr); EndUpdate(macWinPtr); } } } CloseWindow(macWinPtr); exitNow: #ifdef TCL_DEBUG Debugger(); #else abort(); #endif } /* *---------------------------------------------------------------------- * * panic -- * * Print an error message and kill the process. * * Results: * None. * * Side effects: * The process dies, entering the debugger if possible. * *---------------------------------------------------------------------- */ #pragma ignore_oldstyle on void panic(char * format, ...) { va_list varg; char errorText[256]; if (panicProc != NULL) { va_start(varg, format); (void) (*panicProc)(format, varg); va_end(varg); } else { va_start(varg, format); vsprintf(errorText, format, varg); va_end(varg); MacPanic(errorText); } } #pragma ignore_oldstyle reset