The way that the REST server's error handling code uses drupal_add_http_header() isn't consistent with the way it's used in core and is probably incorrect. The attached patch fixes this (and incidentally makes logging easier).

For reference, here's an example from bootstrap.inc:
drupal_add_http_header('Status', '404 Not Found');
and from RESTServer.inc:
drupal_add_http_header('HTTP/1.0 204 No Content', $exception->getMessage());

CommentFileSizeAuthor
services-fix-header-usage.patch1.89 KBcotto

Comments

marcingy’s picture

Status: Needs review » Reviewed & tested by the community

Leaving rtbc for a couple of days for others to speak up then I will commit.

cotto’s picture

In case anyone's wondering, it's kosher to use custom reason phrases according to the http spec:

The reason phrases listed here are only recommendations -- they MAY be replaced by local equivalents without affecting the protocol.

cotto’s picture

Status: Reviewed & tested by the community » Fixed

I see no complaints and no new test failures, so I've committed this as c533e0f0d86a3ad5b86732c516d6b1ad94d04c86. Thanks for the eyeballs.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.