Bug 1122047

Summary: If 'Accept' header field is not explicitly specified, server responds with empty body upon REST query metric/data/{scheduleId}/raw
Product: [JBoss] JBoss Operations Network Reporter: Jan Bednarik <jbednari>
Component: RESTAssignee: Libor Zoubek <lzoubek>
Status: CLOSED CURRENTRELEASE QA Contact: Armine Hovsepyan <ahovsepy>
Severity: medium Docs Contact:
Priority: unspecified    
Version: JON 3.2CC: lkrejci, mfoley, mkoci, theute
Target Milestone: DR01   
Target Release: JON 3.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-12-11 14:04:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

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