Last modified: 2012-04-16 09:15:45 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T28631, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 26631 - Add support for Expect 100 Continue Status
Add support for Expect 100 Continue Status
Status: RESOLVED WONTFIX
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
unspecified
All All
: Lowest enhancement (vote)
: ---
Assigned To: Roan Kattouw
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-01-07 22:07 UTC by Smallman
Modified: 2012-04-16 09:15 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Smallman 2011-01-07 22:07:13 UTC
Add support for the use of the 100 (Continue) Status header for POSTS per HTTP/1.1 W3C RFC 2616
http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html
Comment 1 Brion Vibber 2011-01-08 00:52:45 UTC
Unfortunately I don't think PHP exposes a way to handle this.

Quick summary of how it's intended to work:

- client sends *headers only* for an HTTP POST request, including the 'Expect: 100-continue" header
- client waits for a bit while...
- server processes the headers for the incoming request and sees the 'Expect' header
- server performs some (unspecified, app-specific) sort of validation of the request based on the available headers, knowing that it does not yet have the actual POST request body
- server sends either an HTTP 100 Continue response or an HTTP 417 Expectation Failed response as a signal to the client
- client wakes back up and, if it got the 100, sends the actual request body.
- server processes the complete request, which now has both headers *and* a request body.
- server sends response body back to client
- client is done!

The problem is that we would need to hook in *between* the processing of the headers and the return of the 100 or 417 status... but our PHP code isn't running yet, because we don't get initialized until the entire request body has been read and processed.

I haven't tested for sure, but most likely either the header gets ignored, or Apache/PHP send back a 100 under more or less all circumstances.


Now, even if we did have a way to process it, I'm not sure how useful it would be. Validation of login state, user permissions, and data validity will usually be dependent on parameters that are typically sent in the POST body, so they wouldn't be available yet before the request body has come through.
Comment 2 Roan Kattouw 2011-01-08 11:54:04 UTC
(In reply to comment #1)
> Now, even if we did have a way to process it, I'm not sure how useful it would
> be. Validation of login state, user permissions, and data validity will usually
> be dependent on parameters that are typically sent in the POST body, so they
> wouldn't be available yet before the request body has come through.
You're exactly right, it would be of almost zero use. If PHP/Apache currently send an unconditional 100 back, this bug is WONTFIX. If PHP/Apache somehow misbehave and break clients expecting proper behavior according to spec, that's a bug, but that'd be PHP's or Apache's fault, not ours. Could the reporter clarify which one they meant (i.e. is this a feature request or a bug)?
Comment 3 Smallman 2011-01-08 16:59:28 UTC
A feature request...currently it responds with a 417 (Expectation Failed) as per protocol...so this should be marked as WONTFIX.

@Brion Vibber...thanks for explaining why it  wouldn't be of much use.
Comment 4 Roan Kattouw 2011-01-08 22:48:50 UTC
(In reply to comment #3)
> A feature request...currently it responds with a 417 (Expectation Failed) as
> per protocol...so this should be marked as WONTFIX.
> 
Closing WONTFIX then.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links