Skip to content

Retrieve latest headers and cookies #161

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Codetrauma
Copy link
Contributor

No description provided.

@Codetrauma Codetrauma requested a review from 0xtsukino March 18, 2025 22:26
@Codetrauma Codetrauma linked an issue Mar 26, 2025 that may be closed by this pull request
@Codetrauma Codetrauma marked this pull request as ready for review March 26, 2025 16:11
@Codetrauma Codetrauma requested a review from heeckhau March 26, 2025 16:25
@Codetrauma Codetrauma requested a review from 0xtsukino April 8, 2025 22:11

await Promise.all([
sublevel.put(name, value),
timestampSublevel.put(name, timestamp.toString()),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there!

we do not care about timestamping each key, we only care about timestamp per URL.

Instead of timestamping here, you should time stamp whenever a request is intercepted. You can just add a method setTimestampForUrl above this line: https://github.com/tlsnotary/tlsn-extension/blob/main/src/entries/Background/handlers.ts#L22

const headerLink = url
? Object.keys(links).filter((l) => minimatch(l, link))[0]
const matchedLink = url
? Object.keys(links).filter((l) => l === link || minimatch(l, link))[0]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of returning the first filtered result, return the MOST RECENT filtered result based on url timestamp

const sublevel = db.sublevel(matchedLink);
const timestampSublevel = sublevel.sublevel('timestamp');

for await (const [key, rawValue] of sublevel.iterator({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cookie 🍪 conundrum
2 participants