SShortSingh.
Back to feed

PubTrivia's WebSocket server limits open HTTP routes to a basic health check

0
·1 views

PubTrivia runs a separate long-lived Node process that holds WebSocket connections for its quiz sessions, and it exposes three HTTP routes plus a catch-all 404. The public /health route returns only liveness data: a status flag, the number of active sessions and connected clients, and whether Redis fan-out is enabled. A second route, /internal/stats, lists every live session with its player count, so the author required a shared secret for it, since aggregating that list is more sensitive than any single session ID. Requests without the correct secret receive a 401 response, and unknown paths return a 404. The author notes the secret comparison checks lengths before using a constant-time comparison, because that function throws on mismatched lengths.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Python check flags shifted columns and empty rows in PDF-extracted tables

PDF table extraction can look correct on screen yet fail downstream when merged cells shift columns, headers get read as data, or page breaks drop rows. The article presents a short pdfplumber-based script that runs right after extraction to check table structure. The check flags rows with inconsistent cell counts, fully empty rows, and headers that don't match an expected column list. It cannot detect well-formed values that are simply wrong, so the author suggests comparing totals against the source. For tables with merged headers, the author recommends explicit table_settings and running the check per header block.

0
ProgrammingDEV Community ·

Only 28 US States Set a 180-Day School Year, a New Survey of All 51 Rules Finds

A new dataset compiled from current state law and board rules for all 50 states and DC shows that the common assumption of a 180-day school year is not universal. Only 28 states write 180 days into their rules, while 12 set no statewide day count and instead require a minimum number of instructional hours. Requirements vary widely, from Colorado's 160-day minimum to Kansas's 186 days for grades K-11, and Texas measures instruction in minutes. The creators released the data as a free CSV and JSON file, with the table also available on GradeKind, and note that Oregon and West Virginia have pending rule changes.

0
ProgrammingDEV Community ·

Essay Argues AI Could Write Novels with Structures Beyond Human Cognition

An essay on DEV Community contends that the most interesting post-human literature would not simply be an AI-written novel but one whose structure no human mind could conceive. It notes that human readers and writers are limited in how many characters, plot threads, and themes they can track at once, while a novel could in principle involve thousands of interlinked characters and multidimensional plot constraints. The author distinguishes three senses of impossibility for such a structure: combinatorial, cognitive, and aesthetic. The piece says the first is already achievable with AI, while the others remain frontier and speculative goals. It also challenges the assumption that literature must center on human experience.

0
ProgrammingDEV Community ·

Engineering a Site Model Pipeline Across Five Tools Hinges on Shared Control Points

The article argues that site modeling teams should evaluate the workflow between tools rather than their individual features. It stresses that every project must establish a fixed control point, with datum, coordinate system, and units defined, so separately produced models can be combined. GenAnywhere is described as producing terrain surfaces that keep their identity through edits, which allows grading studies to be versioned inputs. MicroStation is presented as the authoritative geometry store that enforces standards and records changes for auditability. The piece highlights concurrency as the main challenge for CityWeft, where multiple authors edit scenario layers simultaneously.