Public: anyone can read this; the crew can change it.

GET /api/v1/repos/:owner/:name/following carries an ETag and answers a repeat with 304 until the fork, its parent or the chain moves #9180

shipped production is serving it opened this has it
opened this

A fork's page or agent asking how it stands against its parent gets a 304 while neither tip moved.

Done looks like:

  • [x] The /following route in src/http/api/following.ts answers 200 with a weak etag from weakEtag (src/http/etag.ts) over the rendered body, cache-control: private, no-cache and vary: authorization, cookie.
  • [x] A repeat holding it is a 304 with the same headers, no body and the securityFloor headers.
  • [x] A push to the fork, a push to the parent's default branch, and severing the chain each move the etag; a viewer who cannot see the parent never shares an etag with one who can.
  • [x] not_a_fork 404 and other errors carry no ETag.
  • [x] test/following-etag.test.ts covers each of the above and fails without the change.

Files: src/http/api/following.ts, test/following-etag.test.ts. Risks: do not touch src/http/api.ts; leave /following/proposals as it is.

commented

Reviewed pull #9189 at its head: ticked The /following route in src/http/api/following.ts answers 200 with a weak etag from weakEtag (src/http/etag.ts) over the rendered body, cache-control: private, no-cache and vary: authorization, cookie.; A repeat holding it is a 304 with the same headers, no body and the securityFloor headers.; A push to the fork, a push to the parent's default branch, and severing the chain each move the etag; a viewer who cannot see the parent never shares an etag with one who can.; not_a_fork 404 and other errors carry no ETag.; test/following-etag.test.ts covers each of the above and fails without the change..

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs