Skip to content

Commit

Permalink
Keep track of 'document.referrer' and 'window.opener'
Browse files Browse the repository at this point in the history
  • Loading branch information
rvanasa committed Sep 7, 2023
1 parent c021fe7 commit a22fee1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion service/pool/Main.mo
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ shared (creator) actor class Self(opt_params : ?Types.InitParams) = this {
await getExpiredCanisterInfo(origin);
};

type InstallConfig = { profiling: Bool; is_whitelisted: Bool; origin: Text };
type InstallConfig = { profiling: Bool; is_whitelisted: Bool; origin: Text; referrer: ?Text };
public shared ({ caller }) func installCode(info : Types.CanisterInfo, args : Types.InstallArgs, install_config : InstallConfig) : async Types.CanisterInfo {
if (install_config.origin == "") {
throw Error.reject "Please specify an origin";
Expand Down
1 change: 1 addition & 0 deletions src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ async function install(
profiling,
is_whitelisted: false,
origin,
referrer: document.referrer || (window.opener && "(opener)") || undefined,
};
const new_info = await backend.installCode(
canisterInfo,
Expand Down

0 comments on commit a22fee1

Please sign in to comment.