embulk-input-http 0.22.0 → 0.23.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5d4db1e839abd5e9c5d84c54cbda141d3ffe613f
4
- data.tar.gz: 94c29e9b318d8eaa383c2a46a6131c4b5a1c770e
3
+ metadata.gz: 175926ebb8b9f4dbff0a806fc559ac1a1103f517
4
+ data.tar.gz: 14a442cbeb472243bc4b83b1bf448d6da11afa8a
5
5
  SHA512:
6
- metadata.gz: 8ce9962babf185be1fa4909d1d2fa697e3df54bbb4b79ac3fb2b43006b9fbe4b11d98763c9b0fc6862615e174dddffe17a24607e432bb7873d7ced2c44618aab
7
- data.tar.gz: 88f88ed98d50eed6fc97e68284b083879ab0586ff0459e1642050698b90e385e2676f450fca2cc6f61f0351d8ddfb161c740e8feea870a70081b041172490fbc
6
+ metadata.gz: c8b5fa9860063ad4fa3f659cd53df83de39ea6d6ec6aa54fa308833cfe5ac730497c0c2f1a4f5992dfaec3862455faabfd93d8fded6c4e3936357683b755aa65
7
+ data.tar.gz: 30b3254118b8eeb453a748fa9dbf27e047f61fa3efe616bdc2e8c74b72b199f77574dd2213b6f6f2c7c3b24acbc61827eb91d52f9bcc78069f0f6bd2b3ed4f75
@@ -13,7 +13,7 @@ configurations {
13
13
  provided
14
14
  }
15
15
 
16
- version = "0.22.0"
16
+ version = "0.23.0"
17
17
 
18
18
  sourceCompatibility = 1.7
19
19
  targetCompatibility = 1.7
@@ -46,6 +46,7 @@ import java.io.UnsupportedEncodingException;
46
46
  import java.net.URISyntaxException;
47
47
  import java.nio.file.Files;
48
48
  import java.util.ArrayList;
49
+ import java.util.HashMap;
49
50
  import java.util.List;
50
51
  import java.util.Locale;
51
52
  import java.util.Map;
@@ -204,13 +205,19 @@ public class HttpFileInputPlugin implements FileInputPlugin {
204
205
  }
205
206
 
206
207
  private List<Header> makeHeaders(PluginTask task) {
207
- List<Header> headers = new ArrayList<>();
208
- headers.add(new BasicHeader("Accept", "*/*"));
209
- headers.add(new BasicHeader("Accept-Charset", task.getCharset()));
210
- headers.add(new BasicHeader("Accept-Encoding", "gzip, deflate"));
211
- headers.add(new BasicHeader("Accept-Language", "en-us,en;q=0.5"));
212
- headers.add(new BasicHeader("User-Agent", task.getUserAgent()));
208
+ Map<String, String> map = new HashMap<>();
209
+ map.put("Accept", "*/*");
210
+ map.put("Accept-Charset", task.getCharset());
211
+ map.put("Accept-Encoding", "gzip, deflate");
212
+ map.put("Accept-Language", "en-us,en;q=0.5");
213
+ map.put("User-Agent", task.getUserAgent());
213
214
  for (Map.Entry<String, String> entry : task.getRequestHeaders().entrySet()) {
215
+ // Overwrite default headers by user defined headers
216
+ map.put(entry.getKey(), entry.getValue());
217
+ }
218
+
219
+ List<Header> headers = new ArrayList<>();
220
+ for (Map.Entry<String, String> entry : map.entrySet()) {
214
221
  headers.add(new BasicHeader(entry.getKey(), entry.getValue()));
215
222
  }
216
223
  return headers;
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-input-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.22.0
4
+ version: 0.23.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takuma kanari
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-05 00:00:00.000000000 Z
11
+ date: 2019-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -53,7 +53,7 @@ files:
53
53
  - classpath/commons-codec-1.11.jar
54
54
  - classpath/commons-io-2.6.jar
55
55
  - classpath/commons-logging-1.2.jar
56
- - classpath/embulk-input-http-0.22.0.jar
56
+ - classpath/embulk-input-http-0.23.0.jar
57
57
  - classpath/httpclient-4.5.9.jar
58
58
  - classpath/httpcore-4.4.11.jar
59
59
  - config/checkstyle/checkstyle.xml