Uploaded image for project: 'Olingo'
  1. Olingo
  2. OLINGO-1433

Allow HEAD requests on media streams

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • (Java) V4 4.7.1
    • None
    • odata4-server

    Description

      Dear Olingo developers,

      Performing a HEAD request on a media entity's stream URL (`Entity/$value`) throws the following exception:

      HTTP method HEAD is not allowed.
        at org.apache.olingo.server.core.ODataDispatcher.throwMethodNotAllowed(ODataDispatcher.java:674)
        at org.apache.olingo.server.core.ODataDispatcher.handleMediaValueDispatching(ODataDispatcher.java:359)
      

      The change is trivial:

      ODataDispatcher.java line 338 change the condition to:

      if (method == HttpMethod.GET || method == HttpMethod.HEAD)
      

      Need:

      Our OData service also serves files via media entities.
      Web browsers and download utilities often perform an initial HEAD request to get some informations about the file to download (name, size, ...)

      Olingo-odata2 does not prevent HEAD request from reaching the processors implemented by the user.

      We would like to migrate our service to OData 4.

      Thanks,
      Jon.

      Attachments

        Activity

          People

            Unassigned Unassigned
            baylej Jonathan Bayle
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: