Skip to content

Sensitive case on parameters parsed from uri when readΒ #1488

@rodrigoms-b

Description

@rodrigoms-b

Questions

I'm trying to generate a PgConnectOptions from a URI and some parameters are not set, for example the connectTimeout. This is because the parser saves the names in lowercase here: https://github.com/eclipse-vertx/vertx-sql-client/blob/master/vertx-pg-client/src/main/java/io/vertx/pgclient/impl/PgConnectionUriParser.java#L164

Version

4.4.4

Do you have a reproducer?

I am calling:

String connectionUri = "postgresql://localhost:51246/defaultdb?loggerLevel=OFF&connectTimeout=25000" 
JsonObject parsedConfiguration = PgConnectionUriParser.parse(connectionUri)

And I am getting:

{"host":"localhost","port":51246,"database":"defaultdb","loggerlevel":"OFF","connecttimeout":"25000"}

or

String uri = "postgresql://localhost:51246/defaultdb?loggerLevel=OFF&connectTimeout=25000" 
PgConnectOption pgConnectOption = PgConnectOptions.fromUri(url)
pgConnectOption.getConnectTimeout() // 60000 insted of 25000

Parameters are case sensitive in the vertex core:
https://github.com/javalibrary/vert.x/blob/master/src/main/generated/io/vertx/core/net/ClientOptionsBaseConverter.java#L15

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions