Uploaded image for project: 'GeoServer'
  1. GEOS-8349

Monitor REST API won't return xml/json representation for request since 2.12.0

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 2.12.0, 2.13-beta
    • Fix Version/s: 2.12.1
    • Component/s: Monitoring, REST
    • Labels:
      None
    • Environment:

      Description

      When using Audit log endpoint /rest/monitor/* path, server will return only html representation:

      $ curl -vv http://localhost:8080/geoserver/rest/monitor/requests/1.html
      *   Trying 127.0.0.1...
      * TCP_NODELAY set
      * Connected to localhost (127.0.0.1) port 8080 (#0)
      > GET /geoserver/rest/monitor/requests/1.html HTTP/1.1
      > Host: localhost:8080
      > User-Agent: curl/7.54.0
      > Accept: */*
      > 
      < HTTP/1.1 200 OK
      < Date: Tue, 17 Oct 2017 09:09:15 GMT
      < Set-Cookie: JSESSIONID=node01f7eq6w2in071w4uxth17nqyf17.node0;Path=/geoserver
      < Expires: Thu, 01 Jan 1970 00:00:00 GMT
      < Content-Type: text/html
      < Transfer-Encoding: chunked
      < Server: Jetty(9.4.7.v20170914)
      < 
      <html>
        <head>
          <style type="text/css">
            /*-----------------------
      General styles
      -----------------------*/
      body {
      background: #fff;
      .. (and rest of html)..
      

      However, if XML or JSON representation will be requested, HTTP 406 will be returned:

      $ curl -vv http://localhost:8080/geoserver/rest/monitor/requests/1.xml
      *   Trying 127.0.0.1...
      * TCP_NODELAY set
      * Connected to localhost (127.0.0.1) port 8080 (#0)
      > GET /geoserver/rest/monitor/requests/1.xml HTTP/1.1
      > Host: localhost:8080
      > User-Agent: curl/7.54.0
      > Accept: */*
      > 
      < HTTP/1.1 406 Not Acceptable
      < Date: Tue, 17 Oct 2017 09:12:46 GMT
      < Set-Cookie: JSESSIONID=node01tw9ways7yvh11kylb04jwxwid18.node0;Path=/geoserver
      < Expires: Thu, 01 Jan 1970 00:00:00 GMT
      < Content-Length: 0
      < Server: Jetty(9.4.7.v20170914)
      < 
      * Connection #0 to host localhost left intact
      
      $ curl -vv http://localhost:8080/geoserver/rest/monitor/requests/1.json
      *   Trying 127.0.0.1...
      * TCP_NODELAY set
      * Connected to localhost (127.0.0.1) port 8080 (#0)
      > GET /geoserver/rest/monitor/requests/1.json HTTP/1.1
      > Host: localhost:8080
      > User-Agent: curl/7.54.0
      > Accept: */*
      > 
      < HTTP/1.1 406 Not Acceptable
      < Date: Tue, 17 Oct 2017 09:12:48 GMT
      < Set-Cookie: JSESSIONID=node01mo2swwbhe8jw1mt4nufoysrzy19.node0;Path=/geoserver
      < Expires: Thu, 01 Jan 1970 00:00:00 GMT
      < Content-Length: 0
      < Server: Jetty(9.4.7.v20170914)
      < 
      * Connection #0 to host localhost left intact
      

      Tested with build with recent master

        Attachments

          Activity

            People

            • Assignee:
              aaime Andrea Aime
              Reporter:
              cezio Cezary Statkiewicz
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: