Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send requests via HTTPS by default #64

Merged
merged 3 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* BREAKING: Drop support for EOL'd Ruby 2.x
* Prevent duplicate assembly steps [#49](https://github.com/transloadit/ruby-sdk/issues/27) (@ifedapoolarewaju)
* Send "Transloadit-Client" header for every request (@ifedapoolarewaju)
* Send all requests via HTTPS by default

### 2.0.1 / 2017-01-23 ###

Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source "http://rubygems.org"
source "https://rubygems.org"

gemspec
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ completed, or examine other attributes of the request.
response[:assembly_id] # => '9bd733a...'

# returns the API URL endpoint for the assembly
response[:assembly_url] # => 'http://api2.vivian.transloadit.com/assemblies/9bd733a...'
response[:assembly_ssl_url] # => 'https://api2.vivian.transloadit.com/assemblies/9bd733a...'

# checks how many bytes were expected / received by transloadit
response[:bytes_expected] # => 92933
Expand Down Expand Up @@ -198,7 +198,7 @@ You can also tell a step to use the original uploaded file by passing the
Symbol `:original` instead of another step.

Check the YARD documentation for more information on using
[use](http://rubydoc.info/gems/transloadit/frames/Transloadit/Step#use-instance_method).
[use](https://rubydoc.info/gems/transloadit/frames/Transloadit/Step#use-instance_method).

### 4. Creating an Assembly with Templates

Expand Down Expand Up @@ -258,7 +258,7 @@ transloadit = Transloadit.new(
)

transloadit.assembly(
:notify_url => 'http://example.com/processing_finished'
:notify_url => 'https://example.com/processing_finished'
).create! open('/PATH/TO/FILE.mpg')
```

Expand Down Expand Up @@ -413,8 +413,8 @@ and more can be found [here](https://github.com/transloadit/ruby-sdk/tree/master
## Documentation

Up-to-date YARD documentation is automatically generated. You can view the
docs for the <a href="http://rubydoc.info/gems/transloadit/frames" rel="canonical">released gem</a> or
for the latest [git master](http://rubydoc.info/github/transloadit/ruby-sdk/master/frames).
docs for the <a href="https://rubydoc.info/gems/transloadit/frames" rel="canonical">released gem</a> or
for the latest [git master](https://rubydoc.info/github/transloadit/ruby-sdk/master/frames).

## Compatibility

Expand Down
4 changes: 2 additions & 2 deletions lib/transloadit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def initialize(options = {})
# @param [String] name the name to give the step
# @param [String] robot the robot to use in this step (e.g., '/image/resize')
# @param [Hash] options a hash of options to customize the robot's
# operation; see the {online documentation}[http://transloadit.com/docs/building-assembly-instructions]
# operation; see the {online documentation}[https://transloadit.com/docs/building-assembly-instructions]
# for robot-specific options
# @return [Step] the created Step
#
Expand All @@ -66,7 +66,7 @@ def step(name, robot, options = {})
#
# @param [Hash] options additional parameters to send with the assembly
# submission; for a full list of parameters, see the official
# documentation on {templates}[http://transloadit.com/docs/templates].
# documentation on {templates}[https://transloadit.com/docs/templates].
# @option options [Step, Array<Step>] :steps the steps to perform in this
# assembly
# @option options [String] :notify_url A URL to be POSTed when the assembly
Expand Down
4 changes: 2 additions & 2 deletions lib/transloadit/assembly.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def steps
# server-side template. It's submitted along with a list of files to process,
# at which point Transloadit will process and store the files according to the
# rules in the Assembly.
# See the Transloadit {documentation}[http://transloadit.com/docs/building-assembly-instructions]
# See the Transloadit {documentation}[https://transloadit.com/docs/building-assembly-instructions]
# for futher information on Assemblies and their parameters.
#
# Accepts as many IO objects as you wish to process in the assembly.
Expand All @@ -36,7 +36,7 @@ def steps
# @param [Array<IO>] *ios the files for the assembly to process
# @param [Hash] params additional POST data to submit with the request;
# for a full list of parameters, see the official documentation
# on {templates}[http://transloadit.com/docs/templates].
# on {templates}[https://transloadit.com/docs/templates].
# @option params [Step, Array<Step>] :steps the steps to perform in this
# assembly
# @option params [String] :notify_url A URL to be POSTed when the assembly
Expand Down
4 changes: 2 additions & 2 deletions lib/transloadit/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ def self._hmac(key, message)
#
def api(options = {})
@api ||= case url.host
when String then RestClient::Resource.new(url.host, options)
else RestClient::Resource.new(API_ENDPOINT.host, options)
when String then RestClient::Resource.new("#{url.scheme}://#{url.host}", options)
else RestClient::Resource.new("#{API_ENDPOINT.scheme}://#{API_ENDPOINT.host}", options)
end
end

Expand Down
4 changes: 2 additions & 2 deletions lib/transloadit/response/assembly.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

module Transloadit::Response::Assembly
def reload!
replace Transloadit::Request.new(self["assembly_url"]).get
replace Transloadit::Request.new(self["assembly_ssl_url"]).get
end

def cancel!
replace Transloadit::Request.new(self["assembly_url"]).delete
replace Transloadit::Request.new(self["assembly_ssl_url"]).delete
end

def aborted?
Expand Down
4 changes: 2 additions & 2 deletions lib/transloadit/step.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# +robot+ (e.g., '/image/resize' or '/video/thumbnail') and a hash of
# +options+ specific to the chosen robot.
#
# See the Transloadit {documentation}[http://transloadit.com/docs/building-assembly-instructions]
# See the Transloadit {documentation}[https://transloadit.com/docs/building-assembly-instructions]
# for futher information on robot types and their parameters.
#
class Transloadit::Step
Expand Down Expand Up @@ -38,7 +38,7 @@ def initialize(name, robot, options = {})
#
# @param [Step, Array<Step>, Symbol, nil] input The input
# step to use. Follows the conventions outlined in the
# online {documentation}[http://transloadit.com/docs/building-assembly-instructions#special-parameters].
# online {documentation}[https://transloadit.com/docs/building-assembly-instructions#special-parameters].
# The symbol +:original+ specifies that the original file should be sent
# to the robot. A Step indicates that this Step's output should be used
# as the input to this one. Likewise, an array of Steps tells Transloadit
Expand Down
6 changes: 3 additions & 3 deletions test/fixtures/cassettes/cancel_assembly.yml

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

2 changes: 1 addition & 1 deletion test/fixtures/cassettes/create_template.yml

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

2 changes: 1 addition & 1 deletion test/fixtures/cassettes/delete_template.yml

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

2 changes: 1 addition & 1 deletion test/fixtures/cassettes/fetch_assemblies.yml

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

6 changes: 3 additions & 3 deletions test/fixtures/cassettes/fetch_assembly_aborted.yml

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

6 changes: 3 additions & 3 deletions test/fixtures/cassettes/fetch_assembly_errors.yml

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

6 changes: 3 additions & 3 deletions test/fixtures/cassettes/fetch_assembly_executing.yml

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

2 changes: 1 addition & 1 deletion test/fixtures/cassettes/fetch_assembly_notifications.yml

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

Loading
Loading