martinklepsch / s3-beam

🚀 direct-to-S3 uploading using ClojureScript
Eclipse Public License 1.0
92 stars 17 forks source link

Handle errors, object key naming, and headers #24

Closed kennyjwilli closed 8 years ago

kennyjwilli commented 8 years ago

Related issue. Here is an example usage of the new feature. It allows for dynamically created headers and URL parameters.This change does not break the external API.

(defn jwt-headers
  []
  {"Authorization" (str "Token " (u/get-jwt))})

(s3b/s3-pipe uploaded {:server-url "/sign"
                       :headers    (fn [] (http/jwt-headers))
                       :params     (fn [file] {:file-path (.-fullPath file)})})
kennyjwilli commented 8 years ago

I have merged @GetContented (from #21) with mine. I removed the dynamically created parameters because that was really just solving the same problem that the key-fn is now solving. See README's changelog for full list of changes.

GetContented commented 8 years ago

@kennyjwilli thanks so much for picking this up. <3

martinklepsch commented 8 years ago

Thanks this looks really good.I'm thinking I'll just merge this but if anyone is interested in working on a minimal test suite I'd be very happy about such contribution :)