ConvertAPI / convertapi-ruby

A Ruby Gem for the ConvertAPI
https://www.convertapi.com
MIT License
11 stars 10 forks source link

StoreFile not honored #27

Open ramaboo opened 6 months ago

ramaboo commented 6 months ago

The following code:

    result = ConvertApi.convert('txt', { File: document.url, StoreFile: false, RemoveHeadersFooters: true }, from_format: 'pdf')

makes a call to the url with &StoreFile=true.

I think the problem is here: https://github.com/ConvertAPI/convertapi-ruby/blob/88ed026ac1679829f48cb36157c4127457d18a9f/lib/convert_api/task.rb#L11

I think you merge default parameters over top user parameters when you should be doing the merge the other way.

This seems like kind of a security risk having it this way especially since your documentation at: https://www.convertapi.com/pdf-to-txt#snippet=ruby clearly states that the default is false not true.

ramaboo commented 6 months ago

Fixed in this PR https://github.com/ConvertAPI/convertapi-ruby/pull/28