CommunitySolidServer/docs/modules/_util_headerutil_.html
2020-12-27 18:58:48 +00:00

723 lines
42 KiB
HTML

<!doctype html>
<html class="default no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>&quot;util/HeaderUtil&quot; | Community Solid Server</title>
<meta name="description" content="Documentation for Community Solid Server">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../assets/css/main.css">
</head>
<body>
<header>
<div class="tsd-page-toolbar">
<div class="container">
<div class="table-wrap">
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.json" data-base="..">
<div class="field">
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
<input id="tsd-search-field" type="text" />
</div>
<ul class="results">
<li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li>
</ul>
<a href="../index.html" class="title">Community Solid Server</a>
</div>
<div class="table-cell" id="tsd-widgets">
<div id="tsd-filter">
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
<div class="tsd-filter-group">
<div class="tsd-select" id="tsd-filter-visibility">
<span class="tsd-select-label">All</span>
<ul class="tsd-select-list">
<li data-value="public">Public</li>
<li data-value="protected">Public/Protected</li>
<li data-value="private" class="selected">All</li>
</ul>
</div>
<input type="checkbox" id="tsd-filter-inherited" checked />
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
<input type="checkbox" id="tsd-filter-externals" checked />
<label class="tsd-widget" for="tsd-filter-externals">Externals</label>
<input type="checkbox" id="tsd-filter-only-exported" />
<label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label>
</div>
</div>
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
</div>
</div>
</div>
</div>
<div class="tsd-page-title">
<div class="container">
<ul class="tsd-breadcrumb">
<li>
<a href="../globals.html">Globals</a>
</li>
<li>
<a href="_util_headerutil_.html">&quot;util/HeaderUtil&quot;</a>
</li>
</ul>
<h1>Module &quot;util/HeaderUtil&quot;</h1>
</div>
</div>
</header>
<div class="container container-main">
<div class="row">
<div class="col-8 col-content">
<section class="tsd-panel-group tsd-index-group">
<h2>Index</h2>
<section class="tsd-panel tsd-index-panel">
<div class="tsd-index-content">
<section class="tsd-index-section ">
<h3>Interfaces</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-interface tsd-parent-kind-module"><a href="../interfaces/_util_headerutil_.accept.html" class="tsd-kind-icon">Accept</a></li>
<li class="tsd-kind-interface tsd-parent-kind-module"><a href="../interfaces/_util_headerutil_.acceptcharset.html" class="tsd-kind-icon">Accept<wbr>Charset</a></li>
<li class="tsd-kind-interface tsd-parent-kind-module"><a href="../interfaces/_util_headerutil_.acceptencoding.html" class="tsd-kind-icon">Accept<wbr>Encoding</a></li>
<li class="tsd-kind-interface tsd-parent-kind-module"><a href="../interfaces/_util_headerutil_.acceptheader.html" class="tsd-kind-icon">Accept<wbr>Header</a></li>
<li class="tsd-kind-interface tsd-parent-kind-module"><a href="../interfaces/_util_headerutil_.acceptlanguage.html" class="tsd-kind-icon">Accept<wbr>Language</a></li>
<li class="tsd-kind-interface tsd-parent-kind-module"><a href="../interfaces/_util_headerutil_.forwarded.html" class="tsd-kind-icon">Forwarded</a></li>
</ul>
</section>
<section class="tsd-index-section tsd-is-not-exported">
<h3>Variables</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-variable tsd-parent-kind-module tsd-is-not-exported"><a href="_util_headerutil_.html#logger" class="tsd-kind-icon">logger</a></li>
<li class="tsd-kind-variable tsd-parent-kind-module tsd-is-not-exported"><a href="_util_headerutil_.html#token" class="tsd-kind-icon">token</a></li>
</ul>
</section>
<section class="tsd-index-section ">
<h3>Functions</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-function tsd-parent-kind-module"><a href="_util_headerutil_.html#addheader" class="tsd-kind-icon">add<wbr>Header</a></li>
<li class="tsd-kind-function tsd-parent-kind-module"><a href="_util_headerutil_.html#parseaccept" class="tsd-kind-icon">parse<wbr>Accept</a></li>
<li class="tsd-kind-function tsd-parent-kind-module"><a href="_util_headerutil_.html#parseacceptcharset" class="tsd-kind-icon">parse<wbr>Accept<wbr>Charset</a></li>
<li class="tsd-kind-function tsd-parent-kind-module"><a href="_util_headerutil_.html#parseacceptencoding" class="tsd-kind-icon">parse<wbr>Accept<wbr>Encoding</a></li>
<li class="tsd-kind-function tsd-parent-kind-module"><a href="_util_headerutil_.html#parseacceptlanguage" class="tsd-kind-icon">parse<wbr>Accept<wbr>Language</a></li>
<li class="tsd-kind-function tsd-parent-kind-module tsd-is-not-exported"><a href="_util_headerutil_.html#parseacceptpart" class="tsd-kind-icon">parse<wbr>Accept<wbr>Part</a></li>
<li class="tsd-kind-function tsd-parent-kind-module"><a href="_util_headerutil_.html#parseforwarded" class="tsd-kind-icon">parse<wbr>Forwarded</a></li>
<li class="tsd-kind-function tsd-parent-kind-module tsd-is-not-exported"><a href="_util_headerutil_.html#parsenoparameters" class="tsd-kind-icon">parse<wbr>NoParameters</a></li>
<li class="tsd-kind-function tsd-parent-kind-module"><a href="_util_headerutil_.html#parseparameters" class="tsd-kind-icon">parse<wbr>Parameters</a></li>
<li class="tsd-kind-function tsd-parent-kind-module"><a href="_util_headerutil_.html#splitandclean" class="tsd-kind-icon">split<wbr>And<wbr>Clean</a></li>
<li class="tsd-kind-function tsd-parent-kind-module tsd-is-not-exported"><a href="_util_headerutil_.html#testqvalue" class="tsd-kind-icon">testQValue</a></li>
<li class="tsd-kind-function tsd-parent-kind-module"><a href="_util_headerutil_.html#transformquotedstrings" class="tsd-kind-icon">transform<wbr>Quoted<wbr>Strings</a></li>
</ul>
</section>
</div>
</section>
</section>
<section class="tsd-panel-group tsd-member-group tsd-is-not-exported">
<h2>Variables</h2>
<section class="tsd-panel tsd-member tsd-kind-variable tsd-parent-kind-module tsd-is-not-exported">
<a name="logger" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagConst">Const</span> logger</h3>
<div class="tsd-signature tsd-kind-icon">logger<span class="tsd-signature-symbol">:</span> <a href="../classes/_logging_logger_.logger.html" class="tsd-signature-type">Logger</a><span class="tsd-signature-symbol"> = getLoggerFor(&#x27;HeaderUtil&#x27;)</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/solid/community-server/blob/97e7e42/src/util/HeaderUtil.ts#L5">src/util/HeaderUtil.ts:5</a></li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-variable tsd-parent-kind-module tsd-is-not-exported">
<a name="token" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagConst">Const</span> token</h3>
<div class="tsd-signature tsd-kind-icon">token<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">RegExp</span><span class="tsd-signature-symbol"> = /^[a-zA-Z0-9!#$%&amp;&#x27;*+-.^_&#x60;|~]+$/u</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/solid/community-server/blob/97e7e42/src/util/HeaderUtil.ts#L97">src/util/HeaderUtil.ts:97</a></li>
</ul>
</aside>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Functions</h2>
<section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module">
<a name="addheader" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagConst">Const</span> add<wbr>Header</h3>
<ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module">
<li class="tsd-signature tsd-kind-icon">add<wbr>Header<span class="tsd-signature-symbol">(</span>response<span class="tsd-signature-symbol">: </span><a href="_server_httpresponse_.html#httpresponse" class="tsd-signature-type">HttpResponse</a>, name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, value<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/solid/community-server/blob/97e7e42/src/util/HeaderUtil.ts#L363">src/util/HeaderUtil.ts:363</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Adds a header value without overriding previous values.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>response: <a href="_server_httpresponse_.html#httpresponse" class="tsd-signature-type">HttpResponse</a></h5>
</li>
<li>
<h5>name: <span class="tsd-signature-type">string</span></h5>
</li>
<li>
<h5>value: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module">
<a name="parseaccept" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagConst">Const</span> parse<wbr>Accept</h3>
<ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module">
<li class="tsd-signature tsd-kind-icon">parse<wbr>Accept<span class="tsd-signature-symbol">(</span>input<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/_util_headerutil_.accept.html" class="tsd-signature-type">Accept</a><span class="tsd-signature-symbol">[]</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/solid/community-server/blob/97e7e42/src/util/HeaderUtil.ts#L282">src/util/HeaderUtil.ts:282</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Parses an Accept header string.</p>
</div>
<dl class="tsd-comment-tags">
<dt>throws</dt>
<dd><p><a href="../classes/_util_errors_badrequesthttperror_.badrequesthttperror.html">BadRequestHttpError</a>
Thrown on invalid header syntax.</p>
</dd>
</dl>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>input: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The Accept header string.</p>
</div>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="../interfaces/_util_headerutil_.accept.html" class="tsd-signature-type">Accept</a><span class="tsd-signature-symbol">[]</span></h4>
<p>An array of <a href="../interfaces/_util_headerutil_.accept.html">Accept</a> objects, sorted by weight.</p>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module">
<a name="parseacceptcharset" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagConst">Const</span> parse<wbr>Accept<wbr>Charset</h3>
<ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module">
<li class="tsd-signature tsd-kind-icon">parse<wbr>Accept<wbr>Charset<span class="tsd-signature-symbol">(</span>input<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/_util_headerutil_.acceptcharset.html" class="tsd-signature-type">AcceptCharset</a><span class="tsd-signature-symbol">[]</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/solid/community-server/blob/97e7e42/src/util/HeaderUtil.ts#L300">src/util/HeaderUtil.ts:300</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Parses an Accept-Charset header string.</p>
</div>
<dl class="tsd-comment-tags">
<dt>throws</dt>
<dd><p><a href="../classes/_util_errors_badrequesthttperror_.badrequesthttperror.html">BadRequestHttpError</a>
Thrown on invalid header syntax.</p>
</dd>
</dl>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>input: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The Accept-Charset header string.</p>
</div>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="../interfaces/_util_headerutil_.acceptcharset.html" class="tsd-signature-type">AcceptCharset</a><span class="tsd-signature-symbol">[]</span></h4>
<p>An array of <a href="../interfaces/_util_headerutil_.acceptcharset.html">AcceptCharset</a> objects, sorted by weight.</p>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module">
<a name="parseacceptencoding" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagConst">Const</span> parse<wbr>Accept<wbr>Encoding</h3>
<ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module">
<li class="tsd-signature tsd-kind-icon">parse<wbr>Accept<wbr>Encoding<span class="tsd-signature-symbol">(</span>input<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/_util_headerutil_.acceptencoding.html" class="tsd-signature-type">AcceptEncoding</a><span class="tsd-signature-symbol">[]</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/solid/community-server/blob/97e7e42/src/util/HeaderUtil.ts#L323">src/util/HeaderUtil.ts:323</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Parses an Accept-Encoding header string.</p>
</div>
<dl class="tsd-comment-tags">
<dt>throws</dt>
<dd><p><a href="../classes/_util_errors_badrequesthttperror_.badrequesthttperror.html">BadRequestHttpError</a>
Thrown on invalid header syntax.</p>
</dd>
</dl>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>input: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The Accept-Encoding header string.</p>
</div>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="../interfaces/_util_headerutil_.acceptencoding.html" class="tsd-signature-type">AcceptEncoding</a><span class="tsd-signature-symbol">[]</span></h4>
<p>An array of <a href="../interfaces/_util_headerutil_.acceptencoding.html">AcceptEncoding</a> objects, sorted by weight.</p>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module">
<a name="parseacceptlanguage" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagConst">Const</span> parse<wbr>Accept<wbr>Language</h3>
<ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module">
<li class="tsd-signature tsd-kind-icon">parse<wbr>Accept<wbr>Language<span class="tsd-signature-symbol">(</span>input<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/_util_headerutil_.acceptlanguage.html" class="tsd-signature-type">AcceptLanguage</a><span class="tsd-signature-symbol">[]</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/solid/community-server/blob/97e7e42/src/util/HeaderUtil.ts#L344">src/util/HeaderUtil.ts:344</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Parses an Accept-Language header string.</p>
</div>
<dl class="tsd-comment-tags">
<dt>throws</dt>
<dd><p><a href="../classes/_util_errors_badrequesthttperror_.badrequesthttperror.html">BadRequestHttpError</a>
Thrown on invalid header syntax.</p>
</dd>
</dl>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>input: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The Accept-Language header string.</p>
</div>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="../interfaces/_util_headerutil_.acceptlanguage.html" class="tsd-signature-type">AcceptLanguage</a><span class="tsd-signature-symbol">[]</span></h4>
<p>An array of <a href="../interfaces/_util_headerutil_.acceptlanguage.html">AcceptLanguage</a> objects, sorted by weight.</p>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module tsd-is-not-exported">
<a name="parseacceptpart" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagConst">Const</span> parse<wbr>Accept<wbr>Part</h3>
<ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon">parse<wbr>Accept<wbr>Part<span class="tsd-signature-symbol">(</span>part<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, replacements<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/_util_headerutil_.accept.html" class="tsd-signature-type">Accept</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/solid/community-server/blob/97e7e42/src/util/HeaderUtil.ts#L199">src/util/HeaderUtil.ts:199</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Parses a single media range with corresponding parameters from an Accept header.
For every parameter value that is a double quoted string,
we check if it is a key in the replacements map.
If yes the value from the map gets inserted instead.</p>
</div>
<dl class="tsd-comment-tags">
<dt>throws</dt>
<dd><p><a href="../classes/_util_errors_badrequesthttperror_.badrequesthttperror.html">BadRequestHttpError</a>
Thrown on invalid type, qvalue or parameter syntax.</p>
</dd>
</dl>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>part: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>A string corresponding to a media range and its corresponding parameters.</p>
</div>
</div>
</li>
<li>
<h5>replacements: <span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">&gt;</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The double quoted strings that need to be replaced.</p>
</div>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="../interfaces/_util_headerutil_.accept.html" class="tsd-signature-type">Accept</a></h4>
<p><a href="../interfaces/_util_headerutil_.accept.html">Accept</a> object corresponding to the header string.</p>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module">
<a name="parseforwarded" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagConst">Const</span> parse<wbr>Forwarded</h3>
<ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module">
<li class="tsd-signature tsd-kind-icon">parse<wbr>Forwarded<span class="tsd-signature-symbol">(</span>value<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/_util_headerutil_.forwarded.html" class="tsd-signature-type">Forwarded</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/solid/community-server/blob/97e7e42/src/util/HeaderUtil.ts#L403">src/util/HeaderUtil.ts:403</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Parses a Forwarded header value.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5><span class="tsd-flag ts-flagDefault value">Default value</span> value: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = &quot;&quot;</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The Forwarded header value.</p>
</div>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="../interfaces/_util_headerutil_.forwarded.html" class="tsd-signature-type">Forwarded</a></h4>
<p>The parsed Forwarded header.</p>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module tsd-is-not-exported">
<a name="parsenoparameters" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagConst">Const</span> parse<wbr>NoParameters</h3>
<ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon">parse<wbr>NoParameters<span class="tsd-signature-symbol">(</span>input<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>range<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span>weight<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol">[]</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/solid/community-server/blob/97e7e42/src/util/HeaderUtil.ts#L251">src/util/HeaderUtil.ts:251</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Parses an Accept-* header where each part is only a value and a weight, so roughly /.<em>(q=.</em>)?/ separated by commas.</p>
</div>
<dl class="tsd-comment-tags">
<dt>throws</dt>
<dd><p><a href="../classes/_util_errors_badrequesthttperror_.badrequesthttperror.html">BadRequestHttpError</a>
Thrown on invalid qvalue syntax.</p>
</dd>
</dl>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>input: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Input header string.</p>
</div>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-symbol">{ </span>range<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span>weight<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol">[]</span></h4>
<p>An array of ranges and weights.</p>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module">
<a name="parseparameters" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagConst">Const</span> parse<wbr>Parameters</h3>
<ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module">
<li class="tsd-signature tsd-kind-icon">parse<wbr>Parameters<span class="tsd-signature-symbol">(</span>parameters<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span>, replacements<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span>value<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol">[]</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/solid/community-server/blob/97e7e42/src/util/HeaderUtil.ts#L162">src/util/HeaderUtil.ts:162</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Parses a list of split parameters and checks their validity.</p>
</div>
<dl class="tsd-comment-tags">
<dt>throws</dt>
<dd><p><a href="../classes/_util_errors_badrequesthttperror_.badrequesthttperror.html">BadRequestHttpError</a>
Thrown on invalid parameter syntax.</p>
</dd>
</dl>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>parameters: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>A list of split parameters (token [ &quot;=&quot; ( token / quoted-string ) ])</p>
</div>
</div>
</li>
<li>
<h5>replacements: <span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">&gt;</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The double quoted strings that need to be replaced.</p>
</div>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-symbol">{ </span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span>value<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol">[]</span></h4>
<p>An array of name/value objects corresponding to the parameters.</p>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module">
<a name="splitandclean" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagConst">Const</span> split<wbr>And<wbr>Clean</h3>
<ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module">
<li class="tsd-signature tsd-kind-icon">split<wbr>And<wbr>Clean<span class="tsd-signature-symbol">(</span>input<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/solid/community-server/blob/97e7e42/src/util/HeaderUtil.ts#L128">src/util/HeaderUtil.ts:128</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Splits the input string on commas, trims all parts and filters out empty ones.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>input: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Input header string.</p>
</div>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module tsd-is-not-exported">
<a name="testqvalue" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagConst">Const</span> testQValue</h3>
<ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon">testQValue<span class="tsd-signature-symbol">(</span>qvalue<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/solid/community-server/blob/97e7e42/src/util/HeaderUtil.ts#L141">src/util/HeaderUtil.ts:141</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Checks if the input string matches the qvalue regex.</p>
</div>
<dl class="tsd-comment-tags">
<dt>throws</dt>
<dd><p><a href="../classes/_util_errors_badrequesthttperror_.badrequesthttperror.html">BadRequestHttpError</a>
Thrown on invalid syntax.</p>
</dd>
</dl>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>qvalue: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Input qvalue string (so &quot;q=....&quot;).</p>
</div>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module">
<a name="transformquotedstrings" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagConst">Const</span> transform<wbr>Quoted<wbr>Strings</h3>
<ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module">
<li class="tsd-signature tsd-kind-icon">transform<wbr>Quoted<wbr>Strings<span class="tsd-signature-symbol">(</span>input<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>replacements<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">; </span>result<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> }</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/solid/community-server/blob/97e7e42/src/util/HeaderUtil.ts#L106">src/util/HeaderUtil.ts:106</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Replaces all double quoted strings in the input string with <code>&quot;0&quot;</code>, <code>&quot;1&quot;</code>, etc.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>input: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The Accept header string.</p>
</div>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-symbol">{ </span>replacements<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">; </span>result<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> }</span></h4>
<p>The transformed string and a map with keys <code>&quot;0&quot;</code>, etc. and values the original string that was there.</p>
<ul class="tsd-parameters">
<li class="tsd-parameter">
<h5>replacements<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">&gt;</span></h5>
</li>
<li class="tsd-parameter">
<h5>result<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5>
</li>
</ul>
</li>
</ul>
</section>
</section>
</div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<nav class="tsd-navigation primary">
<ul>
<li class="globals ">
<a href="../globals.html"><em>Globals</em></a>
</li>
<li class="current tsd-kind-module">
<a href="_util_headerutil_.html">&quot;util/<wbr>Header<wbr>Util&quot;</a>
</li>
</ul>
</nav>
<nav class="tsd-navigation secondary menu-sticky">
<ul class="before-current">
<li class=" tsd-kind-interface tsd-parent-kind-module">
<a href="../interfaces/_util_headerutil_.accept.html" class="tsd-kind-icon">Accept</a>
</li>
<li class=" tsd-kind-interface tsd-parent-kind-module">
<a href="../interfaces/_util_headerutil_.acceptcharset.html" class="tsd-kind-icon">Accept<wbr>Charset</a>
</li>
<li class=" tsd-kind-interface tsd-parent-kind-module">
<a href="../interfaces/_util_headerutil_.acceptencoding.html" class="tsd-kind-icon">Accept<wbr>Encoding</a>
</li>
<li class=" tsd-kind-interface tsd-parent-kind-module">
<a href="../interfaces/_util_headerutil_.acceptheader.html" class="tsd-kind-icon">Accept<wbr>Header</a>
</li>
<li class=" tsd-kind-interface tsd-parent-kind-module">
<a href="../interfaces/_util_headerutil_.acceptlanguage.html" class="tsd-kind-icon">Accept<wbr>Language</a>
</li>
<li class=" tsd-kind-interface tsd-parent-kind-module">
<a href="../interfaces/_util_headerutil_.forwarded.html" class="tsd-kind-icon">Forwarded</a>
</li>
<li class=" tsd-kind-variable tsd-parent-kind-module tsd-is-not-exported">
<a href="_util_headerutil_.html#logger" class="tsd-kind-icon">logger</a>
</li>
<li class=" tsd-kind-variable tsd-parent-kind-module tsd-is-not-exported">
<a href="_util_headerutil_.html#token" class="tsd-kind-icon">token</a>
</li>
<li class=" tsd-kind-function tsd-parent-kind-module">
<a href="_util_headerutil_.html#addheader" class="tsd-kind-icon">add<wbr>Header</a>
</li>
<li class=" tsd-kind-function tsd-parent-kind-module">
<a href="_util_headerutil_.html#parseaccept" class="tsd-kind-icon">parse<wbr>Accept</a>
</li>
<li class=" tsd-kind-function tsd-parent-kind-module">
<a href="_util_headerutil_.html#parseacceptcharset" class="tsd-kind-icon">parse<wbr>Accept<wbr>Charset</a>
</li>
<li class=" tsd-kind-function tsd-parent-kind-module">
<a href="_util_headerutil_.html#parseacceptencoding" class="tsd-kind-icon">parse<wbr>Accept<wbr>Encoding</a>
</li>
<li class=" tsd-kind-function tsd-parent-kind-module">
<a href="_util_headerutil_.html#parseacceptlanguage" class="tsd-kind-icon">parse<wbr>Accept<wbr>Language</a>
</li>
<li class=" tsd-kind-function tsd-parent-kind-module tsd-is-not-exported">
<a href="_util_headerutil_.html#parseacceptpart" class="tsd-kind-icon">parse<wbr>Accept<wbr>Part</a>
</li>
<li class=" tsd-kind-function tsd-parent-kind-module">
<a href="_util_headerutil_.html#parseforwarded" class="tsd-kind-icon">parse<wbr>Forwarded</a>
</li>
<li class=" tsd-kind-function tsd-parent-kind-module tsd-is-not-exported">
<a href="_util_headerutil_.html#parsenoparameters" class="tsd-kind-icon">parse<wbr>NoParameters</a>
</li>
<li class=" tsd-kind-function tsd-parent-kind-module">
<a href="_util_headerutil_.html#parseparameters" class="tsd-kind-icon">parse<wbr>Parameters</a>
</li>
<li class=" tsd-kind-function tsd-parent-kind-module">
<a href="_util_headerutil_.html#splitandclean" class="tsd-kind-icon">split<wbr>And<wbr>Clean</a>
</li>
<li class=" tsd-kind-function tsd-parent-kind-module tsd-is-not-exported">
<a href="_util_headerutil_.html#testqvalue" class="tsd-kind-icon">testQValue</a>
</li>
<li class=" tsd-kind-function tsd-parent-kind-module">
<a href="_util_headerutil_.html#transformquotedstrings" class="tsd-kind-icon">transform<wbr>Quoted<wbr>Strings</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<footer>
<div class="container">
<h2>Legend</h2>
<div class="tsd-legend-group">
<ul class="tsd-legend">
<li class="tsd-kind-object-literal"><span class="tsd-kind-icon">Object literal</span></li>
<li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li>
<li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li>
<li class="tsd-kind-function tsd-has-type-parameter"><span class="tsd-kind-icon">Function with type parameter</span></li>
<li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li>
<li class="tsd-kind-type-alias tsd-has-type-parameter"><span class="tsd-kind-icon">Type alias with type parameter</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li>
<li class="tsd-kind-interface tsd-has-type-parameter"><span class="tsd-kind-icon">Interface with type parameter</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li>
<li class="tsd-kind-class tsd-has-type-parameter"><span class="tsd-kind-icon">Class with type parameter</span></li>
</ul>
</div>
</div>
</footer>
<div class="overlay"></div>
<script src="../assets/js/main.js"></script>
</body>
</html>