{
  "id": 3971727,
  "title": "If-Match: two curls, one 412",
  "url": "https://urgent.news/2026/08/28/if-match-two-curls-one-412",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-08-28T13:47:14.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/robertpaschal/if-match-two-curls-one-412-4df5"
  },
  "original_language": "en",
  "account": "Two tabs overwrite the same note. The first tab's content vanishes. Two endpoints on your machine are two tabs. You GET. You type. You PUT. Save this as if-match-server.mjs . Execute the file with node if-match-server.mjs . Import the http module. Create a note object with text as \"hello\". Establish an ETag of 1. Construct a server using http.createServer. Respond with a 404 error if the URL does not match /note . Respond with a 200 response and the note's text and ETag for GET requests. Reject non-PUT requests with a 405 error. Capture raw data from requests and store it in raw. If the IF-Match header matches the ETag, proceed with the PUT request. Parse the JSON request body and update the note's text and increment the ETag. Return a 200 response with the updated note and ETag. Listen on port 3456 for incoming connections at localhost.",
  "summary": "Two tabs save the same note. Last write wins. The first tab's words vanish. Two terminals on your laptop are two tabs. You GET. You type. You PUT. Save this as if-match-server.mjs . Run node if-match-server.mjs . import http from \" node:http \" ; let note = { text : \" hello \" }; let etag = \" 1 \" ; http . createServer (( req , res ) => { const reply = ( status , body ) => { const json = JSON .…",
  "key_points": [
    "Two tabs overwrite same note, first tab's content vanishes",
    "GET request returns 200 with note text and ETag",
    "PUT request updates note if IF-Match header matches ETag"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}