Bug 1122047 - If 'Accept' header field is not explicitly specified, server responds with empty body upon REST query metric/data/{scheduleId}/raw
Summary: If 'Accept' header field is not explicitly specified, server responds with em...
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Operations Network
Classification: JBoss
Component: REST
Version: JON 3.2
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: DR01
: JON 3.3.0
Assignee: Libor Zoubek
QA Contact: Armine Hovsepyan
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-22 12:35 UTC by Jan Bednarik
Modified: 2015-11-02 00:44 UTC (History)
4 users (show)

(edit)
Clone Of:
(edit)
Last Closed: 2014-12-11 14:04:51 UTC


Attachments (Terms of Use)

Description Jan Bednarik 2014-07-22 12:35:46 UTC
Description of problem:
If the REST query GET <host>:7080/rest/metric/data/<scheduleId>/raw is sent to the server but 'Accept' header field is not explicitly set to 'application/json', the server responds with empty body.

Version-Release number of selected component (if applicable):
RHQ 4.12

How reproducible:
always

Steps to Reproduce:
1. invoke command curl -u rhqadmin:rhqadmin http://<host_ip>:7080/rest/metric/data/<scheduleId>/raw
2. check the server responds with empty body
3. invoke command curl -u rhqadmin:rhqadmin -H 'Accept:application/json'  http://<host_ip>:7080/rest/metric/data/<scheduleId>/raw
4. check that server responds as expected

Actual results:


Expected results:


Additional info:

Comment 1 Libor Zoubek 2014-07-24 15:26:46 UTC
in master

commit a0ba10f41ee50096b1285ced75c335e34026ae44
Author: Libor Zoubek <lzoubek@redhat.com>
Date:   Thu Jul 24 17:24:55 2014 +0200

    Bug 1122047 - If 'Accept' header field is not explicitly specified, server
    responds with empty body upon REST query metric/data/{scheduleId}/raw

    in case accept header does not specify media type, we fallback to JSON.

Comment 2 Lukas Krejci 2014-07-24 15:32:56 UTC
in release/jon3.3.x

commit 9d94427b0e6f454d1f015139c16b50a3ba8f4ce9
Author: Libor Zoubek <lzoubek@redhat.com>
Date:   Thu Jul 24 17:24:55 2014 +0200

    Bug 1122047 - If 'Accept' header field is not explicitly specified, server
    responds with empty body upon REST query metric/data/{scheduleId}/raw
    
    in case accept header does not specify media type, we fallback to JSON.
    
    (cherry picked from commit a0ba10f41ee50096b1285ced75c335e34026ae44)
    Signed-off-by: Lukas Krejci <lkrejci@redhat.com>

Comment 3 Simeon Pinder 2014-07-31 15:52:27 UTC
Moving to ON_QA as available to test with brew build of DR01: https://brewweb.devel.redhat.com//buildinfo?buildID=373993

Comment 4 Jan Bednarik 2014-08-06 12:18:25 UTC
Moving to VERIFIED.

Now the server responds as expected even if the 'Accept' header field is not explicitly set to 'application/json'

Version: 3.3.0.DR01
Build Number: 6468454:dda0a47


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