Skip to content

Commit 1930f44

Browse files
authored
Server Error bug when path long
This fixes the SQL problem `SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'path'` when user attempt to access very long URL path or some vulnerability scanner (e.g. Qualys PCI DSS scanner). Steps to reproduce: 1. Go to your app URL. 2. Enter very long path that exceeds 255 characters. 3. An SQL error will appear on logs and page will return 5xx error instead of 404. Example error log (executed by Qualys VAPT) ![SQL 1406 Error](https://i.ibb.co/gMcMvCh/Screen-Shot-2022-01-25-at-5-54-00-PM.png)
1 parent 1747837 commit 1930f44

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

database/migrations/create_request_logs_table.php.stub

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ return new class extends Migration
1919
$table->unsignedSmallInteger('status')->nullable();
2020
$table->string('method')->nullable();
2121
$table->string('route')->nullable(); // Not all routes needs to have a name
22-
$table->string('path')->nullable();
22+
$table->text('path')->nullable();
2323
$table->json('headers')->nullable();
2424
$table->json('payload')->nullable();
2525
$table->json('response_headers')->nullable();

0 commit comments

Comments
 (0)