Skip to content

Commit

Permalink
removed param decode. RequestParam annotation already does decode
Browse files Browse the repository at this point in the history
  • Loading branch information
brunovg committed Sep 8, 2023
1 parent da3cc24 commit e6efc69
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import org.springframework.web.bind.annotation.*;

import java.io.*;
import java.net.URLDecoder;
import java.sql.Connection;
import java.sql.SQLException;

Expand Down Expand Up @@ -41,10 +40,6 @@ public ValidationErrorMessage validateJdbc(

try {
ConnectionType connectionType = ConnectionType.valueOf(type.toUpperCase());
host = URLDecoder.decode(host, "UTF-8");
userName = URLDecoder.decode(userName, "UTF-8");
password = URLDecoder.decode(password, "UTF-8");
database = URLDecoder.decode(database, "UTF-8");

JDBCConnection jdbcConnection = JDBCConnection.builder()
.setUsername(userName)
Expand All @@ -60,7 +55,7 @@ public ValidationErrorMessage validateJdbc(
DatabaseAdapter adapter = connectionType.getAdapter();

connection = jdbcConnection.connect(adapter);
} catch (SQLException | UnsupportedEncodingException | ClassNotFoundException | InstantiationException | IllegalAccessException e) {
} catch (SQLException | ClassNotFoundException | InstantiationException | IllegalAccessException e) {
return new ValidationErrorMessage(e.getMessage());
} finally {
close(connection);
Expand Down

0 comments on commit e6efc69

Please sign in to comment.