Skip to content
Snippets Groups Projects
Verified Commit d146d637 authored by Andrej Ramašeuski's avatar Andrej Ramašeuski
Browse files

Logujeme referrer

parent 9abe7344
Branches
No related tags found
No related merge requests found
Pipeline #10829 passed
1.1.1 1.2.0
...@@ -17,8 +17,9 @@ sub redirect ($c) { ...@@ -17,8 +17,9 @@ sub redirect ($c) {
} }
$shortcut->add_to_log_items({ $shortcut->add_to_log_items({
ip => ($c->forwarded_for || $c->tx->remote_address), ip => ($c->forwarded_for || $c->tx->remote_address),
ua => $c->req->headers->user_agent, ua => $c->req->headers->user_agent,
referrer => $c->req->headers->referrer,
}); });
$c->res->code($shortcut->code); $c->res->code($shortcut->code);
......
...@@ -21,6 +21,7 @@ __PACKAGE__->add_columns( ...@@ -21,6 +21,7 @@ __PACKAGE__->add_columns(
shortcut_id shortcut_id
ip ip
ua ua
referrer
), ),
); );
......
...@@ -47,3 +47,6 @@ create index "shortcuts_shortcut_idx" on "shortcuts" ("shortcut"); ...@@ -47,3 +47,6 @@ create index "shortcuts_shortcut_idx" on "shortcuts" ("shortcut");
-- 3 up -- 3 up
alter table "log" add column "ua" text; alter table "log" add column "ua" text;
-- 4 up
alter table "log" add column "referrer" text;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment