-
Notifications
You must be signed in to change notification settings - Fork 24
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
base: main
Are you sure you want to change the base?
Conversation
…r setting and retrieving cookies/headers
|
||
await Promise.all([ | ||
sublevel.put(name, value), | ||
timestampSublevel.put(name, timestamp.toString()), |
There was a problem hiding this comment.
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] |
There was a problem hiding this comment.
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({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not needed
No description provided.