Skip to content

Commit c2310d0

Browse files
authored
Fix openSimpleConnection: pass Bearer auth token to /version endpoint (#52)
1 parent 979255a commit c2310d0

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • com.dbeaver.jdbc.driver.libsql/src/main/java/com/dbeaver/jdbc/driver/libsql/client

com.dbeaver.jdbc.driver.libsql/src/main/java/com/dbeaver/jdbc/driver/libsql/client/LibSqlClient.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ public HttpURLConnection openSimpleConnection(String endpoint) throws IOExceptio
164164
baseURL += endpoint;
165165
HttpURLConnection connection = (HttpURLConnection) new URL(baseURL).openConnection();
166166
connection.setRequestProperty(HttpConstants.HEADER_USER_AGENT, userAgent);
167+
if (!CommonUtils.isEmpty(authToken)) {
168+
connection.setRequestProperty(HttpConstants.HEADER_AUTHORIZATION, "Bearer " + authToken);
169+
}
167170
return connection;
168171
}
169172

0 commit comments

Comments
 (0)