We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1ec847c commit 642fbe4Copy full SHA for 642fbe4
src/targets/ruby/native.js
@@ -7,7 +7,12 @@ module.exports = function (source, options) {
7
8
code.push('require \'uri\'')
9
.push('require \'net/http\'')
10
- .blank()
+
11
+ if (source.uriObj.protocol === 'https:') {
12
+ code.push('require \'openssl\'')
13
+ }
14
15
+ code.blank()
16
17
// To support custom methods we check for the supported methods
18
// and if doesn't exist then we build a custom class for it
test/fixtures/output/ruby/native/https.rb
@@ -1,5 +1,6 @@
1
require 'uri'
2
require 'net/http'
3
+require 'openssl'
4
5
url = URI("https://mockbin.com/har")
6
0 commit comments