Skip to content

X-Copy-From request send "application/json" as content type #512

@nhh

Description

@nhh

I am processing videos with carrierwave and fog as storage provider. All videos that are uploaded have the content type "application/json". I already got so far, that i have overriden the CarrierWave::Storage::Fog::File#content_type method but with no success. With that tried i've come to the conclusion, that there is something wrong underneath my processing code.

What i can see with EXCON_DEBUG=true is, that the first request, putting my video into a temp file, works as expected:

:method              => "PUT"
:headers             => {
    "Accept"         => "application/json"
    "Content-Length" => 3267624
    "Content-Type"   => "video/quicktime"
    "Host"           => "storage.sbg.cloud.ovh.net:443"
    "User-Agent"     => "fog-core/2.2.0"
    "X-Auth-Token"   => "XXXXXXXX"
}

I get a 201 Created back. After that, carrierwave processes the file and moves it with fog-openstack into is real destination:

:headers             => {
    "Accept"       => "application/json"
    "Content-Type" => "application/json"
    "Host"         => "storage.sbg.cloud.ovh.net:443"
    "User-Agent"   => "fog-core/2.2.0"
    "X-Auth-Token" => "XXXXXXXX"
    "X-Copy-From"  => "/XXXX_development/uploads/tmp/1590760935-202723548356984-0001-0409/loading_screen_flickers.mov"
  }

The response for the copy request looks as following:

  :headers       => {
    "Content-Length"              => "0"
    "Content-Type"                => "text/html; charset=UTF-8"
    "Date"                        => "Fri, 29 May 2020 14:02:20 GMT"
    "Etag"                        => "e1340ff8ddfb1a8ae1252bc55dae7f85"
    "Last-Modified"               => "Fri, 29 May 2020 14:02:20 GMT"
    "X-Copied-From"               => "XXX_development/uploads/tmp/1590760935-202723548356984-0001-0409/loading_screen_flickers.mov"
    "X-Copied-From-Account"       => "XXXXXXXXXXXX"
    "X-Copied-From-Last-Modified" => "Fri, 29 May 2020 14:02:18 GMT"
    "X-IPLB-Instance"             => "12631"
    "X-Openstack-Request-Id"      => "tx3905d22b0674473e9bd0f-005ed115eb"
    "X-Trans-Id"                  => "tx3905d73b0671173e9bd0f-005ed115eb"
  }

After that, the file which got moved will only be accessible via content type "application/json".

Any ideas?

Best,
Niklas

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions