influxdata / influxdata/influxdb-java

Incorrect URLs formed if base URL contains a path segment

オープン
#268 コメント 4 件 リアクション 5 件 担当者 0 名 GitHub で見る
主要言語
Java
スター
1.2k
フォーク
469
PR マージ指標
30日以内にマージされた PR はありません

説明

(Tested with influxdb-java version 2.5)

We're using a HTTPS reverse proxy in front our influxdb instance.

The external URLs is `https://scala-ci.typesafe.com/influx/write`.

The URL actually generated by influxdb-java is `https://scala-ci.typesafe.com/write`.

I believe that changing `@POST("/write")` to `@POST("write")`, etc, in `InfluxDBService.java` would fix this, but haven't verified.

A workaround is to add an interceptor to fixup the URL.

```java
OkHttpClient.Builder client = new OkHttpClient.Builder();
client.addNetworkInterceptor(chain -> {
HttpUrl.Builder fixedUrl = chain.request().url().newBuilder().encodedPath("/influx/" + chain.request().url().encodedPath().replaceFirst("/influxdb", ""));
return chain.proceed(chain.request().newBuilder().url(fixedUrl.build()).build());
});
InfluxDB influxDB = InfluxDBFactory.connect("https://scala-ci.typesafe.com/influx/", user, password, client);
```

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

まず InfluxDBService.java を読み、その endpoint アノテーションが /influx を含むベース URL とどのように組み合わされるかを追跡します。https://scala-ci.typesafe.com/influx/ に対して報告されたリクエストを再現し、生成された URL が interceptor workaround を必要とせずにベースパスセグメントを保持することを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
api
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
38/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。