Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-15116

Wrong HTTP status for HEAD request

    XMLWordPrintableJSON

Details

    Description

      A GET request for a word that doesn't exist in a managed resource (stopwords or synonyms) returns "404 Not Found", but the HEAD request for the same child resource returns "200 OK" as if the word actually exists.

      $ curl -i "http://localhost:8983/solr/techproducts/schema/analysis/synonyms/english/foobar" | head -n 1
      HTTP/1.1 404 Not Found
      
      $ curl -I "http://localhost:8983/solr/techproducts/schema/analysis/synonyms/english/foobar" | head -n 1
      HTTP/1.1 200 OK
      

      Solr 8.6.3 returns "404 Not Found" for both GET and HEAD requests for a non-existing child resource. This is how it SHOULD be according to RFC 2616:

      The metainformation contained in the HTTP headers in response to a HEAD request SHOULD be identical to the information sent in response to a GET request.

      Attachments

        Issue Links

          Activity

            People

              epugh Eric Pugh
              thomascorthals Thomas Corthals
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h 20m
                  2h 20m