title: Uploading image with Uppy trough Shrine return 405 Method Not Allowed
body: <p>I am trying to use Ruby On Rails as my backend, and gems like ReactOnRails and Shrine, in addition, I use package Uppy to upload the image to AWS S3</p>
  
  <p>So far everything working fine until I trying to upload the image through Uppy which should transfer the AWS credentials through the backend, so I don't expose my secret keys from the front end.</p>
  
  <p>A snippet of React Component</p>
  
  <pre><code>.use(AwsS3, {
    limit: 5,
    // serverUrl: 'https://uppy-companion.my-app.com/',
    strings: {
      preparingUpload: 'Preparing upload...'
    },
    getUploadParameters(file) {
      return fetch('/presign?filename=' + file.name, {
        method: 'post',
        // Send and receive JSON.
        headers: {
          accept: 'application/json',
          'content-type': 'application/json'
        },
        body: JSON.stringify({
          filename: file.name,
          contentType: file.type
        })
      }).then((response) =&gt; {
        // Parse the JSON response.
        return response.json()
      }).then((data) =&gt; {
        // Return an object in the correct shape.
        return {
          method: data.method,
          url: data.url,
          fields: data.fields
        }
      }).catch((error) =&gt; console.log(error))
    }
  });
  </code></pre>
  
  <p>My Routes are </p>
  
  <pre><code>mount Shrine.presign_endpoint(:cache) =&gt; '/presign'
  </code></pre>
  
  <p>and finally my shrine.rb file</p>
  
  <pre><code>require 'shrine'
  
  if Rails.env.production?
    require 'shrine/storage/s3'
  
    s3_options = {
      access_key_id: Rails.application.credentials.aws[:s3_access_key_id],
      secret_access_key: Rails.application.credentials.aws[:s3_secret_access_key],
      region: Rails.application.credentials.aws[:s3_region],
      bucket: Rails.application.credentials.aws[:s3_bucket]
    }
  
    Shrine.storages = {
      cache: Shrine::Storage::S3.new(prefix: 'cache', **s3_options),
      store: Shrine::Storage::S3.new(prefix: "store", **s3_options)
    }
  else
    require 'shrine/storage/file_system'
  
    Shrine.storages = {
      cache: Shrine::Storage::FileSystem.new('public', prefix: 'uploads/cache'),
      store: Shrine::Storage::FileSystem.new('public', prefix: 'uploads')
    }
  end
  
  Shrine.plugin :activerecord
  Shrine.plugin :backgrounding
  Shrine.plugin :logging
  Shrine.plugin :determine_mime_type
  Shrine.plugin :cached_attachment_data
  Shrine.plugin :restore_cached_data
  #TODO: docs
  Shrine.plugin :presign_endpoint if Rails.env.production?
  Shrine.plugin :upload_endpoint if !Rails.env.production?
  
  Shrine::Attacher.promote { |data| PromoteJob.perform_async(data) }
  Shrine::Attacher.delete { |data| DeleteJob.perform_async(data) }
  </code></pre>
  
  <p>my AWS S3 Cros configurations</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"&gt;
  &lt;CORSRule&gt;
      &lt;AllowedOrigin&gt;*&lt;/AllowedOrigin&gt;
      &lt;AllowedMethod&gt;GET&lt;/AllowedMethod&gt;
      &lt;AllowedMethod&gt;PUT&lt;/AllowedMethod&gt;
      &lt;AllowedMethod&gt;POST&lt;/AllowedMethod&gt;
      &lt;AllowedMethod&gt;HEAD&lt;/AllowedMethod&gt;
      &lt;MaxAgeSeconds&gt;3000&lt;/MaxAgeSeconds&gt;
      &lt;AllowedHeader&gt;Authorization&lt;/AllowedHeader&gt;
      &lt;AllowedHeader&gt;x-amz-date&lt;/AllowedHeader&gt;
      &lt;AllowedHeader&gt;x-amz-content-sha256&lt;/AllowedHeader&gt;
      &lt;AllowedHeader&gt;content-type&lt;/AllowedHeader&gt;
  &lt;/CORSRule&gt;
  &lt;CORSRule&gt;
      &lt;AllowedOrigin&gt;*&lt;/AllowedOrigin&gt;
      &lt;AllowedMethod&gt;GET&lt;/AllowedMethod&gt;
      &lt;MaxAgeSeconds&gt;3000&lt;/MaxAgeSeconds&gt;
  &lt;/CORSRule&gt;
  &lt;/CORSConfiguration&gt;
  </code></pre>
  
  <p>I just cannot figure out how to fix this issue when I upload file through the uppy.js.</p>