Skip to content

428 Precondition Required

The server requires conditional headers to prevent ‘lost updates’ where two people edit a file at the same time.

Use this to enforce safe collaborative editing. If a client tries to PUT updates to a shared document without specifying which exact version they are modifying, throw a 428 to force them to use safe conditional headers.

import { HttpException, get } from 'shokupan';
export const getResource = get('/resource', () => {
throw new HttpException('Precondition Required', 428);
});