Skip to content

Commit

Permalink
Fixed sql
Browse files Browse the repository at this point in the history
  • Loading branch information
cultpodcasts committed Feb 17, 2024
1 parent 52ca0e1 commit 5adb1c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ export default {
return new Error(`Invalid url '${url}'.`);
}
let insert = env.DB
.prepare("INSERT INTO urls (url, timestamp, timestamp_date, ip_address, country, user_agent) VALUES (?, ?, ?, ?, ?)")
.bind(url.toString(), Date.now(), new Date().toLocaleString(), request.headers.get("CF-Connecting-IP"), request.headers.get("CF-Connecting-IP"), request.headers.get("User-Agent"));
.prepare("INSERT INTO urls (url, timestamp, timestamp_date, ip_address, country, user_agent) VALUES (?, ?, ?, ?, ?, ?)")
.bind(url.toString(), Date.now(), new Date().toLocaleString(), request.headers.get("CF-Connecting-IP"), request.headers.get("CF-IPCountry"), request.headers.get("User-Agent"));
let result = await insert.run();

if (result.success) {
Expand Down

0 comments on commit 5adb1c5

Please sign in to comment.