Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: include host in $current_url #679

Merged
merged 2 commits into from
Jan 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/api/src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,14 @@
);
}

let currentUrl = opts.req.url;

Check warning on line 121 in packages/api/src/context.ts

View check run for this annotation

Codecov / codecov/patch

packages/api/src/context.ts#L121

Added line #L121 was not covered by tests
let pathname: string | undefined;
let query: string | undefined;

if (opts.req.url) {
const url = new URL(opts.req.url, env.BLOBSCAN_API_BASE_URL);
pathname = url.pathname;
currentUrl = url.toString();

Check warning on line 128 in packages/api/src/context.ts

View check run for this annotation

Codecov / codecov/patch

packages/api/src/context.ts#L128

Added line #L128 was not covered by tests
query = url.searchParams.toString();
}

Expand All @@ -133,7 +135,7 @@
properties: {
$ip: getIP(opts.req),
scope,
$current_url: opts.req.url,
$current_url: currentUrl,

Check warning on line 138 in packages/api/src/context.ts

View check run for this annotation

Codecov / codecov/patch

packages/api/src/context.ts#L138

Added line #L138 was not covered by tests
network: env.NETWORK_NAME,
pathname,
query,
Expand Down
Loading