Skip to content

Main content

HTTP Etag Weak Prefix Token Tool

Compute http etag weak prefix token from explicit bounded inputs.

Loading tool…

Description

Return weak and the literal opaque value.

HTTP fields use specific token, quoted-string, range, quality-weight, and entity-tag grammars. Quoted text is not automatically safe as a filename or equivalent to an escaped string in another language. Parsing one parameter or marker is separate from interpreting a full request or response.

Return weak and the literal opaque value.

When to use this tool

Use HTTP Etag Weak Prefix Token when you need to parse this one supported HTTP field component or parameter token.

How to use the tool and how it works

  1. Enter token. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read weak, opaque. Inspect weak before interpreting the associated values.

Accept an optional uppercase W/ prefix and a double-quoted opaque value composed of permitted visible/Latin-1-range characters. Return weak and the literal opaque value.1

Input fieldMeaning and unitsAccepted input
tokenComplete literal token in the grammar stated above.Required. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
weakWhether uppercase W/ was present.Required. Boolean.
opaqueLiteral opaque-tag content; backslashes are not unescaped.Required. Text; maximum UTF-16 length 8192.
json
{
  "input": {
    "token": "W/\"abc\""
  },
  "output": {
    "weak": true,
    "opaque": "abc"
  }
}

Limitations and assumptions

  • The weak prefix is case-sensitive and backslash is an ordinary opaque character rather than an escape. No resource comparison, cache validation, unquoting beyond the wrapper, or HTTP request is performed.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.

Alternative or Complementary methods

Use a full header parser and the relevant HTTP semantics when request behavior depends on the result. Check extended parameters, field context, and downstream use of returned text separately.

References

  1. Calculation and input contract: parse/http-etag-weak-prefix-token — tool.io

Similar or alternative tools