Skip to content

Commit

Permalink
percent-decode incoming S3 keys
Browse files Browse the repository at this point in the history
it seems like this is new since the last time we deployed? who knows
  • Loading branch information
indirect committed Mar 7, 2022
1 parent 3af5192 commit 196fbd4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ default-run = "kirby"
[dependencies]
argparse = "0.2.2"
aws_lambda = { git = "https://github.com/srijs/rust-aws-lambda" }
enum-map = { version = "0.4.1", features = ["serde"] }
flate2 = { version = "1.0", features = ["zlib"], default-features = false }
futures = "0.3"
lazy_static = "1.1.0"
enum-map = { version = "0.4.1", features = ["serde"] }
log = "0.4.5"
nom = "4.0"
percent-encoding = "2.1.0"
rayon = "1.0.2"
regex = "1"
rusoto_core = { version="0.42", default_features=false, features=["rustls"] }
Expand Down
4 changes: 3 additions & 1 deletion src/bin/kirby-s3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use std::io::BufRead;
use std::io::BufReader;
use std::io::Cursor;
use std::io::Read;
use percent_encoding::percent_decode;

use kirby::Options;
use kirby::stream_stats;
Expand Down Expand Up @@ -70,7 +71,8 @@ fn main() {

for record in input.records {
if let Some(bucket_name) = record.s3.bucket.name {
if let Some(key) = record.s3.object.key {
if let Some(url_key) = record.s3.object.key {
let key = percent_decode(url_key.as_bytes()).decode_utf8()?;
info!(
"{} downloading {}/{}",
time::now_utc().rfc3339(),
Expand Down

0 comments on commit 196fbd4

Please sign in to comment.