Skip to content

Adds expires to supported options#181

Merged
DarthSim merged 2 commits intoimgproxy:masterfrom
Ross-Hunter:feature/expires
Jun 14, 2022
Merged

Adds expires to supported options#181
DarthSim merged 2 commits intoimgproxy:masterfrom
Ross-Hunter:feature/expires

Conversation

@Ross-Hunter
Copy link
Copy Markdown
Contributor

I started working on this because I didn't realize that you can just pass through parameters that aren't explicitly parsed by this library, but the benefit of this PR is that it allows using Time objects directly instead of needing to convert to an integer. It also now explicitly says in the README that expires is supported.

@DarthSim
Copy link
Copy Markdown
Member

DarthSim commented Jun 9, 2022

Hi Ross!

There's no need for an additional test. Just add the expires option to options and its casted string to casted_options and casted_options_full.

@Ross-Hunter
Copy link
Copy Markdown
Contributor Author

I tried that first, but I ran into an issue that I assumed was related to needing signed urls for expiration, but now I think I was just missing a / in the casted options 🤦

Comment thread spec/imgproxy_spec.rb
auto_rotate: true,
filename: "the_image.jpg",
format: :webp,
expires: Time.at(4810374983),
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

100 years from now seems like a safe number here.

@DarthSim DarthSim merged commit 9b360eb into imgproxy:master Jun 14, 2022
@DarthSim
Copy link
Copy Markdown
Member

Thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants