Skip to content

Upgrade asset API calls to v4.1 and pass browser user agent - #233

Open
nicomiguelino wants to merge 1 commit into
masterfrom
feat/asset-api-v4-1-user-agent
Open

Upgrade asset API calls to v4.1 and pass browser user agent#233
nicomiguelino wants to merge 1 commit into
masterfrom
feat/asset-api-v4-1-user-agent

Conversation

@nicomiguelino

Copy link
Copy Markdown
Collaborator

Summary

  • Moves createWebAsset, updateWebAsset, getWebAsset, and the existing-asset lookup in updateProposal from the v4 assets endpoint to v4.1. The v4 endpoint's write grants never included the user_agent column, so there was no way to send it through; v4.1 is a strict superset of v4's fields, so this should be behavior-preserving for everything the extension already reads/writes.
  • createWebAsset/updateWebAsset now accept an optional userAgent parameter and include it as user_agent in the request body when provided.
  • submitAsset now passes navigator.userAgent when creating or updating a web asset, so the browser that captured the page/cookies is recorded on the asset.

Test plan

  • npx tsc --noEmit passes
  • npm test (29 specs, 0 failures)
  • npm run lint:check / npm run format:check clean
  • npm run build compiles successfully
  • Manual smoke test: add/update a web asset via the extension and confirm the asset is created successfully against the v4.1 endpoint

The v4 assets endpoint never granted write access to the user_agent
column, so there was no way to tell Screenly's screenshot/rendering
pipeline which browser produced a saved asset's headers. Move
createWebAsset, updateWebAsset, getWebAsset, and the existing-asset
lookup to v4.1 (a strict superset of v4) and forward navigator.userAgent
when creating or updating a web asset.
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.

1 participant