Solr
  1. Solr
  2. SOLR-2263

RawResponseWriter should properly stream binary as well as textual files

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.1, 4.0-ALPHA
    • Component/s: web gui
    • Labels:
      None

      Description

      I noticed that the RawRequestHandler can NOT properly serve up binary data like images, only textual documents. I dug around for a while and it appears that reading in content via Streams, but sending them out via Writer doesn't work, because of character encoding problems.

      I wanted RawRequestHandler to work with binary images because the /browse handler in 3.x uses some autocomplete functionality that looks for a "indicator.gif" in the /velocity directory. And I'd like to be able to add other binary images to my velocity based search interface.

      After much digging around, I realized that if I made RawResponseWriter implement BinaryQueryResponseWriter, then everything works. I was able to stream both binary images and text documents to the browser.

      Not sure if this is the right path to go, and if there are other ramifications that I don't grok on making this change, so wanted to put it up for discussion.

        Issue Links

          Activity

          Hide
          Eric Pugh added a comment -

          Patch to use Streams instead of Writers.

          Show
          Eric Pugh added a comment - Patch to use Streams instead of Writers.
          Hide
          Yonik Seeley added a comment -

          This seems reasonable to me - I'll commit shortly if there aren't any objections.

          Show
          Yonik Seeley added a comment - This seems reasonable to me - I'll commit shortly if there aren't any objections.
          Hide
          Erik Hatcher added a comment -

          +1!

          Thanks Eric for the patch, and Yonik for picking it up.

          Show
          Erik Hatcher added a comment - +1! Thanks Eric for the patch, and Yonik for picking it up.
          Hide
          Yonik Seeley added a comment -

          Thanks Eric, committed to 3x and trunk.

          Show
          Yonik Seeley added a comment - Thanks Eric, committed to 3x and trunk.
          Hide
          Grant Ingersoll added a comment -

          Bulk close for 3.1.0 release

          Show
          Grant Ingersoll added a comment - Bulk close for 3.1.0 release

            People

            • Assignee:
              Unassigned
              Reporter:
              Eric Pugh
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development