Uploaded image for project: 'Mesos'
  1. Mesos
  2. MESOS-1509

Use Content-Disposition filename (if available) when downloading HTTP URIs

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 0.18.0, 0.19.0, 0.20.0, 0.21.0
    • None
    • agent
    • None
    • Linux (but should be irrelevant)

    Description

      Currently the slave stores downloaded HTTP URIs in filenames that are made up from the part after the last "/" in the URI (in src/launcher/fetcher.cpp:122):

      path =  path::join(directory, path.substr(path.find_last_of("/") + 1));
      

      The problem is that the query string is included in the filename and a URI like http://my.web.server/dynamic/resource.tar.gz?a=b results in a downloaded file named resource.tar.gz?a=b.

      The curl maintainers faced the same problem and added this:

      -J, --remote-header-name
                    (HTTP) This option tells the -O, --remote-name option to use the server-specified Content-Disposition filename instead of extracting a filename from the URL.
      

      Maybe Mesos could do the same if a Content-Disposition header exists.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              bmetzdorf Bjoern Metzdorf
              Votes:
              3 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: