Skip to content

Commit

Permalink
Truncate access address in case it is spoofed
Browse files Browse the repository at this point in the history
Fixes an exception on inserting too long IP address
  • Loading branch information
AuroraLS3 committed May 24, 2024
1 parent ad98e28 commit edb8716
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ protected void performOperations() {
@Override
public void prepare(PreparedStatement statement) throws SQLException {
statement.setLong(1, timestamp);
statement.setString(2, accessAddress);
statement.setString(2, StringUtils.truncate(accessAddress, 45));
statement.setString(3, method);
statement.setString(4, url);
statement.setInt(5, responseCode);
Expand Down

0 comments on commit edb8716

Please sign in to comment.