Uploaded image for project: 'Fedora Repository Project'
  1. Fedora Repository Project
  2. FCREPO-2827

External-Content proxy does not read remote Content-type

    XMLWordPrintable

    Details

      Description

      With a remote resource

      > curl -I http://static-ldp.localhost:8111/2012-12-01/IMG_20121201_113805.jpg
      HTTP/1.1 200 OK
      Date: Tue, 10 Jul 2018 19:10:45 GMT
      Server: Apache/2.4.29 (Unix) PHP/7.2.4
      X-Powered-By: PHP/7.2.4
      Cache-Control: public
      link: <http://www.w3.org/ns/ldp#Resource>; rel="type"
      link: <http://www.w3.org/ns/ldp#NonRDFSource>; rel="type"
      Content-Length: 1377502
      last-modified: Sat, 01 Apr 2017 04:38:24 GMT
      etag: "81949982d5001edc0346f70a44cdc9f78a9bb284"
      Content-Type: image/jpeg

      Running the command

      > curl -ufedoraAdmin:fedoraAdmin -i -XPUT -H"Link: <http://static-ldp.localhost:8111/2012-12-01/IMG_20121201_113805.jpg>; rel=\"http://fedora.info/definitions/fcrepo#ExternalContent\"; handling=\"proxy\"" http://localhost:8080/rest/simple_proxy_test
      HTTP/1.1 201 Created
      Date: Tue, 10 Jul 2018 19:20:26 GMT
      Set-Cookie: JSESSIONID=1juvg76ydzn6qeax61vxyofhg;Path=/
      Expires: Thu, 01 Jan 1970 00:00:00 GMT
      Set-Cookie: rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Mon, 09-Jul-2018 19:20:26 GMT
      ETag: "0480341a7fec5da7d2e05a52b829f2096377189a"
      Last-Modified: Tue, 10 Jul 2018 19:20:26 GMT
      Link: <http://localhost:8080/rest/simple_proxy_test/fcr:metadata>; rel="describedby"; anchor="http://localhost:8080/rest/simple_proxy_test"
      Link: <http://localhost:8080/static/constraints/NonRDFSourceConstraints.rdf>; rel="http://www.w3.org/ns/ldp#constrainedBy"
      Content-Location: http://static-ldp.localhost:8111/2012-12-01/IMG_20121201_113805.jpg
      Link: <http://localhost:8080/rest/simple_proxy_test/fcr:acl>; rel="acl"
      Location: http://localhost:8080/rest/simple_proxy_test
      Content-Type: text/plain
      Content-Length: 44
      Server: Jetty(9.3.1.v20150714)

      http://localhost:8080/rest/simple_proxy_test

      The remote resource gets the default application/octet-stream mimetype instead of image/jpeg

      > curl -ufedoraAdmin:fedoraAdmin -I http://localhost:8080/rest/simple_proxy_test
      HTTP/1.1 200 OK
      Date: Tue, 10 Jul 2018 19:21:02 GMT
      Set-Cookie: JSESSIONID=avegmxz0ejsdajojv21g17yz;Path=/
      Expires: Thu, 01 Jan 1970 00:00:00 GMT
      Set-Cookie: rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Mon, 09-Jul-2018 19:21:02 GMT
      ETag: "0480341a7fec5da7d2e05a52b829f2096377189a"
      Last-Modified: Tue, 10 Jul 2018 19:20:26 GMT
      Content-Type: application/octet-stream
      Accept-Ranges: bytes
      Content-Disposition: attachment; filename=""; creation-date="Tue, 10 Jul 2018 19:20:26 GMT"; modification-date="Tue, 10 Jul 2018 19:20:26 GMT"; size=1377502
      Link: <http://www.w3.org/ns/ldp#Resource>;rel="type"
      Link: <http://www.w3.org/ns/ldp#NonRDFSource>;rel="type"
      Link: <http://localhost:8080/rest/simple_proxy_test/fcr:metadata>; rel="describedby"
      Link: <http://localhost:8080/static/constraints/NonRDFSourceConstraints.rdf>; rel="http://www.w3.org/ns/ldp#constrainedBy"
      Accept-External-Content-Handling: copy,redirect,proxy
      Allow: DELETE,HEAD,GET,PUT,OPTIONS
      Link: <http://localhost:8080/rest/simple_proxy_test/fcr:acl>; rel="acl"
      Content-Location: http://static-ldp.localhost:8111/2012-12-01/IMG_20121201_113805.jpg
      Content-Length: 1377502
      Server: Jetty(9.3.1.v20150714)

       

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              whikloj Jared Whiklo
              Reporter:
              whikloj Jared Whiklo
              Reviewer:
              Ben Pennell
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: