orientdb icon indicating copy to clipboard operation
orientdb copied to clipboard

REST API function calls are returning an extra HTTP 204 response

Open buzzkillington opened this issue 13 years ago • 0 comments

When an OrientDB Function is called through the REST API and responds using "response.send(...)", an extra HTTP 204 response is also sent (presumably upon completion of the Function). This breaks the ability to use a Java REST client (e.g., Jersey).

OrientDB release? (If you're using a SNAPSHOT please attach also the build number found in "build.number" file): 1.3.0

What steps will reproduce the problem? 1.Create an OrientDB Function, for example:

var foo = { id: "foo-123", data: "bar" }; response.send(200, "OK", "application/json", JSON.stringify(foo));

2.Call that Function using the REST API and observe the HTTP exchange (e.g., using TCPMonitor). The HTTP 200 response is sent with the expected JSON content, and a second HTTP 204 response is also sent - immediately appended to the correct response.

What is the expected output? What do you see instead? Expected: HTTP/1.1 200 OK Date: Wed Jan 09 10:26:33 EST 2013 Content-Type: application/json; charset=utf-8 Server: OrientDB Server v.1.3.0 (build 16) Connection: Keep-Alive Set-Cookie: OSESSIONID=OS1357744329499-7581636751388968395; Path=/; HttpOnly Content-Length: 29

{"id":"foo-123","data":"bar"}

Actual: HTTP/1.1 200 OK Date: Wed Jan 09 10:26:33 EST 2013 Content-Type: application/json; charset=utf-8 Server: OrientDB Server v.1.3.0 (build 16) Connection: Keep-Alive Set-Cookie: OSESSIONID=OS1657766329829-77536315951388528264; Path=/; HttpOnly Content-Length: 29

{"id":"foo-123","data":"bar"}HTTP/1.1 204 Date: Wed Jan 09 10:26:33 EST 2013 Content-Type: text/plain; charset=utf-8 Server: OrientDB Server v.1.3.0 (build 16) Connection: Keep-Alive Set-Cookie: OSESSIONID=OS1657766329829-77536315951388528264; Path=/; HttpOnly Content-Length: 0

buzzkillington avatar Jan 14 '13 18:01 buzzkillington