diff --git a/pom.xml b/pom.xml
index a7bb7f6..046c561 100644
--- a/pom.xml
+++ b/pom.xml
@@ -14,7 +14,7 @@
- * taken from https://square.github.io/okhttp/interceptors/
- */
- final class GzipRequestInterceptor implements Interceptor {
- @Override
- public Response intercept(Interceptor.Chain chain) throws IOException {
- Request originalRequest = chain.request();
- if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) {
- return chain.proceed(originalRequest);
- }
-
- Request compressedRequest = originalRequest.newBuilder()
- .header("Content-Encoding", "gzip")
- .method(originalRequest.method(), gzip(originalRequest.body()))
- .build();
- return chain.proceed(compressedRequest);
- }
-
- private RequestBody gzip(final RequestBody body) {
- return new RequestBody() {
- @Override
- public MediaType contentType() {
- return body.contentType();
- }
-
- @Override
- public long contentLength() {
- return -1; // We don't know the compressed length in advance!
- }
-
- @Override
- public void writeTo(BufferedSink sink) throws IOException {
- BufferedSink gzipSink = Okio.buffer(new GzipSink(sink));
- body.writeTo(gzipSink);
- gzipSink.close();
- }
- };
- }
- }
-
@Inject
public HttpOutput(@Assisted Stream stream, @Assisted Configuration conf) throws HttpOutputException {
this.url = conf.getString(CK_OUTPUT_API);
+ this.intake_key = conf.getString(CK_INTAKE_KEY);
this.raise_exception_on_http_error = conf.getBoolean(CK_RAISE_EXCEPTION);
this.shutdown = false;
LOG.info(" Http Output Plugin has been configured with the following parameters:");
LOG.info(CK_OUTPUT_API + " : " + this.url);
- LOG.info(CK_GZIP_REQUEST + " : " + conf.getBoolean(CK_GZIP_REQUEST));
+ LOG.info(CK_INTAKE_KEY + " : " + this.intake_key);
LOG.info(CK_RAISE_EXCEPTION + " : " + this.raise_exception_on_http_error);
try {
@@ -112,9 +71,6 @@ public HttpOutput(@Assisted Stream stream, @Assisted Configuration conf) throws
.writeTimeout(10, TimeUnit.SECONDS)
.readTimeout(5, TimeUnit.SECONDS);
- if (conf.getBoolean(CK_GZIP_REQUEST)) {
- clientBuilder.addInterceptor(new GzipRequestInterceptor());
- }
this.httpClient = clientBuilder.build();
}
@@ -132,26 +88,22 @@ public void stop() {
@Override
public void write(List