[wp-xmlrpc] APP and XMLRPC Ticket questions

Joseph Scott joseph at josephscott.org
Fri Aug 21 18:19:24 UTC 2009


On Aug 21, 2009, at 11:53 AM, Peter Westwood wrote:

> A couple of ticket related questions that I thought I would ask the  
> experts on.
>
> Firstly: <https://core.trac.wordpress.org/ticket/7968>
>
> This is about changing the response of WP when APP disabled from the  
> current plain text response to a wp_die formatted one.
>
> This sounds like a good idea - I just want to make sure that going  
> from plain txt to html isn't going to cause any client issues.



I looked at the current situation versus using wp_die.  The wp_die  
function is really targeted at providing HTML pages to users, so I  
don't think that it's a good fit when talking to other software. And I  
think the other things WP does to work around browser bugs doesn't  
help.  Here is what we current send back (tested with curl -v):

---------------------------------------

< HTTP/1.1 403 Forbidden
< Date: Fri, 21 Aug 2009 18:08:30 GMT
< Server: Apache/2.0.59 (Unix) PHP/5.2.6 DAV/2
< X-Powered-By: PHP/5.2.6
< Content-Length: 132
< Content-Type: text/plain
<
* Connection #0 to host localhost left intact
* Closing connection #0
AtomPub services are disabled on this blog.  An admin user can enable  
them at http://localhost/wp/trunk/wp-admin/options-writing.php

---------------------------------------

And here is the same response after applying this patch - https://core.trac.wordpress.org/attachment/ticket/7968/7968.r10258.diff


---------------------------------------

< HTTP/1.1 403 Forbidden
< Date: Fri, 21 Aug 2009 18:09:49 GMT
< Server: Apache/2.0.59 (Unix) PHP/5.2.6 DAV/2
< X-Powered-By: PHP/5.2.6
< Expires: Wed, 11 Jan 1984 05:00:00 GMT
< Last-Modified: Fri, 21 Aug 2009 18:09:49 GMT
< Cache-Control: no-cache, must-revalidate, max-age=0
< Pragma: no-cache
< Content-Length: 1256
< Content-Type: text/html; charset=utf-8
<
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd 
">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
<head>
         <meta http-equiv="Content-Type" content="text/html;  
charset=utf-8" />
         <title>Atom Feed</title>
         <link rel="stylesheet" href="http://localhost/wp/trunk/wp-admin/css/install.css 
" type="text/css" />
</head>
<body id="error-page">
         <p>AtomPub services are disabled on this blog.  An admin user  
can enable them at http://localhost/wp/trunk/wp-admin/options-writing.php 
</p></body>
<!-- Ticket #8942, IE bug fix: always pad the error page with enough  
characters such that it is greater than 512 bytes, even after gzip  
compression  
abcdefghijklmnopqrstuvwxyz1234567890aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz11223344556677889900abacbcbdcdcededfefegfgfhghgihihjijikjkjlklkmlmlnmnmononpopoqpqprqrqsrsrtstsubcbcdcdedefefgfabcadefbghicjkldmnoepqrfstugvwxhyz1i234j567k890laabmbccnddeoeffpgghqhiirjjksklltmmnunoovppqwqrrxsstytuuzvvw0wxx1yyz2z113223434455666777889890091abc2def3ghi4jkl5mno6pqr7stu8vwx9yz11aab2bcc3dd4ee5ff6gg7hh8ii9j0jk1kl2lmm3nnoo4p5pq6qrr7ss8tt9uuvv0wwx1x2yyzz13aba4cbcb5dcdc6dedfef8egf9gfh0ghg1ihi2hji3jik4jkj5lkl6kml7mln8mnm9ono 
  -->
</html>
* Connection #0 to host localhost left intact
* Closing connection #0

---------------------------------------

I think the patched version is extra work with no reward.


> Secondly: <http://core.trac.wordpress.org/ticket/10658>
>
> This is about improving the feedback on GET requests to xmlrpc.php  
> endpoint.
>
> I like the basic idea of the ticket but I think we can go one better  
> and, using wp_die again, provide feedback on enablement status and a  
> like to documentation on the codex about XMLRPC.


Agreed, in this case we are returning content to a browser for the end  
user, so it should be HTML.  One more additional step would be return  
a more useful message for GET requests even when XML-RPC is enabled.

--
Joseph Scott
joseph at josephscott.org
http://josephscott.org/






More information about the wp-xmlrpc mailing list