Uploaded image for project: 'WildFly WIP'
  1. WildFly WIP
  2. WFWIP-151

HTTP Verb OPTIONS requires to have Accept header defined, response should provide some guidance about this

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Do
    • Icon: Major Major
    • MP Metrics
    • None

      HTTP Verb OPTIONS requires to have Accept header defined

      $ curl -X OPTIONS http://127.0.0.1:10090/metrics/vendor
      No exporter found for method OPTIONS and media type
      

      I have to specify json mediatype

      curl -X OPTIONS -H "Accept: application/json" http://127.0.0.1:10090/metrics/vendor
      

      I was expecting that I get the json response or at least more helpful message.

      OpenLiberty returns

      Error 406: CWMMC0000I: The accept header format */* is incorrect.
      

      which at least points user to define proper header

      Update:
      Spec requires header to be defined, so WF could be a bit more helpful in the response message

      The implementation must return a 406 response code if the request’s HTTP Accept header 
      for an OPTIONS request does not match application/json.
      

              jmesnil1@redhat.com Jeff Mesnil
              rsvoboda@redhat.com Rostislav Svoboda
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: