diff options
Diffstat (limited to 'files/pl/web/http/headers')
-rw-r--r-- | files/pl/web/http/headers/cache-control/index.html | 171 | ||||
-rw-r--r-- | files/pl/web/http/headers/data/index.html | 81 | ||||
-rw-r--r-- | files/pl/web/http/headers/index.html | 374 | ||||
-rw-r--r-- | files/pl/web/http/headers/referrer-policy/index.html | 260 |
4 files changed, 886 insertions, 0 deletions
diff --git a/files/pl/web/http/headers/cache-control/index.html b/files/pl/web/http/headers/cache-control/index.html new file mode 100644 index 0000000000..8ce8eb1f63 --- /dev/null +++ b/files/pl/web/http/headers/cache-control/index.html @@ -0,0 +1,171 @@ +--- +title: Cache-Control +slug: Web/HTTP/Headers/Cache-Control +translation_of: Web/HTTP/Headers/Cache-Control +--- +<div>{{HTTPSidebar}}</div> + +<p><strong><code>Cache-Control</code></strong> nagłówek jest stosowany do określania dyrektyw sterujących pamięcią podręczną w zapytaniu i odpowiedzi protokołu HTTP. Dyrektywy pamięci podręcznej są jednokierunkowe, co oznacza że dyrektywa użyta w zapytaniu klienta HTTP nie musi pojawić się w odpowiedzi serwera.</p> + +<table class="properties"> + <tbody> + <tr> + <th scope="row">Header type</th> + <td>{{Glossary("General header")}}</td> + </tr> + <tr> + <th scope="row">{{Glossary("Forbidden header name")}}</th> + <td>no</td> + </tr> + <tr> + <th scope="row">{{Glossary("Simple response header", "CORS-safelisted response-header")}}</th> + <td>yes</td> + </tr> + </tbody> +</table> + +<h2 id="Składnia">Składnia</h2> + +<p>Wielkość liter nie ma znaczeniu w określaniu dyrektyw. Dyrektywa może posiadać opcjonalny argument który może być podany jako token (słowo) lub string w cudzysłowiu. Możliwe jest podanie wielu dyrektyw przez oddzielenie ich przecinkiem.</p> + +<h3 id="Dyrektywy_zapytania">Dyrektywy zapytania</h3> + +<p>Standardowe dyrektywy nagłówka <code>Cache-Control</code> które mogą być użyte w zapytaniu klienta HTTP.</p> + +<pre class="syntaxbox">Cache-Control: max-age=<seconds> +Cache-Control: max-stale[=<seconds>] +Cache-Control: min-fresh=<seconds> +Cache-Control: no-cache +Cache-Control: no-store +Cache-Control: no-transform +Cache-Control: only-if-cached +</pre> + +<h3 id="Dyrektywy_odpowiedzi">Dyrektywy odpowiedzi</h3> + +<p>Standardowe dyrektywy nagłówka <code>Cache-Control</code> które mogą być użyte w odpowiedzi serwera HTTP.</p> + +<pre class="syntaxbox">Cache-Control: must-revalidate +Cache-Control: no-cache +Cache-Control: no-store +Cache-Control: no-transform +Cache-Control: public +Cache-Control: private +Cache-Control: proxy-revalidate +Cache-Control: max-age=<seconds> +Cache-Control: s-maxage=<seconds> +</pre> + +<h3 id="Extension_Cache-Control_directives">Extension <code>Cache-Control</code> directives</h3> + +<p>Extension <code>Cache-Control</code> directives are not part of the core HTTP caching standards document. Be sure to check the <a href="#Browser_compatibility">compatibility table</a> for their support.</p> + +<pre class="syntaxbox">Cache-Control: immutable +Cache-Control: stale-while-revalidate=<seconds> +Cache-Control: stale-if-error=<seconds> +</pre> + +<h2 id="Directives">Directives</h2> + +<h3 id="Cacheability">Cacheability</h3> + +<dl> + <dt><code>public</code></dt> + <dd>Indicates that the response may be cached by any cache.</dd> + <dt><code>private</code></dt> + <dd>Indicates that the response is intended for a single user and must not be stored by a shared cache. A private cache may store the response.</dd> + <dt><code>no-cache</code></dt> + <dd>Forces caches to submit the request to the origin server for validation before releasing a cached copy.</dd> + <dt><code>only-if-cached</code></dt> + <dd>Indicates to not retrieve new data. This being the case, the server wishes the client to obtain a response only once and then cache. From this moment the client should keep releasing a cached copy and avoid contacting the origin-server to see if a newer copy exists.</dd> +</dl> + +<h3 id="Expiration">Expiration</h3> + +<dl> + <dt><code>max-age=<seconds></code></dt> + <dd>Specifies the maximum amount of time a resource will be considered fresh. Contrary to <code>Expires</code>, this directive is relative to the time of the request.</dd> + <dt><code>s-maxage=<seconds></code></dt> + <dd>Overrides <code>max-age</code> or the <code>Expires</code> header, but it only applies to shared caches (e.g., proxies) and is ignored by a private cache.</dd> + <dt><code>max-stale[=<seconds>]</code></dt> + <dd>Indicates that the client is willing to accept a response that has exceeded its expiration time. Optionally, you can assign a value in seconds, indicating the time the response must not be expired by.</dd> + <dt><code>min-fresh=<seconds></code></dt> + <dd>Indicates that the client wants a response that will still be fresh for at least the specified number of seconds.</dd> + <dt><code>stale-while-revalidate=<seconds></code> {{experimental_inline}}</dt> + <dd>Indicates that the client is willing to accept a stale response while asynchronously checking in the background for a fresh one. The seconds value indicates for how long the client is willing to accept a stale response.</dd> + <dt><code>stale-if-error=<seconds></code> {{experimental_inline}}</dt> + <dd>Indicates that the client is willing to accept a stale response if the check for a fresh one fails. The seconds value indicates for how long the client is willing to accept the stale response after the initial expiration.</dd> +</dl> + +<h3 id="Revalidation_and_reloading">Revalidation and reloading</h3> + +<dl> + <dt><code>must-revalidate</code></dt> + <dd>The cache must verify the status of the stale resources before using it and expired ones should not be used.</dd> + <dt><code>proxy-revalidate</code></dt> + <dd>Same as <code>must-revalidate</code>, but it only applies to shared caches (e.g., proxies) and is ignored by a private cache.</dd> + <dt><code>immutable</code></dt> + <dd>Indicates that the response body will not change over time. The resource, if unexpired, is unchanged on the server and therefore the client should not send a conditional revalidation for it (e.g. <code>If-None-Match</code> or <code>If-Modified-Since</code>) to check for updates, even when the user explicitly refreshes the page. Clients that aren't aware of this extension must ignore them as per the HTTP specification. In Firefox, <code>immutable</code> is only honored on <code>https://</code> transactions. For more information, see also this <a href="http://bitsup.blogspot.de/2016/05/cache-control-immutable.html">blog post</a>.</dd> +</dl> + +<h3 id="Other">Other</h3> + +<dl> + <dt><code>no-store</code></dt> + <dd>The cache should not store anything about the client request or server response.</dd> + <dt><code>no-transform</code></dt> + <dd>No transformations or conversions should be made to the resource. The Content-Encoding, Content-Range, Content-Type headers must not be modified by a proxy. A non- transparent proxy might, for example, convert between image formats in order to save cache space or to reduce the amount of traffic on a slow link. The <code>no-transform</code> directive disallows this.</dd> +</dl> + +<h2 id="Examples">Examples</h2> + +<h3 id="Preventing_caching">Preventing caching</h3> + +<p>To turn off caching, you can send the following response header. In addition, see also the <code>Expires</code> and <code>Pragma</code> headers.</p> + +<pre class="brush: bash">Cache-Control: no-cache, no-store, must-revalidate +</pre> + +<h3 id="Caching_static_assets">Caching static assets</h3> + +<p>For the files in the application that will not change, you can usually add aggressive caching by sending the response header below. This includes static files that are served by the application such as images, CSS files and JavaScript files, for example. In addition, see also the <code>Expires</code> header.</p> + +<pre class="brush: bash">Cache-Control: public, max-age=31536000</pre> + +<h2 id="Specifications">Specifications</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Specification</th> + <th scope="col">Title</th> + </tr> + <tr> + <td>{{RFC("7234")}}</td> + <td>Hypertext Transfer Protocol (HTTP/1.1): Caching</td> + </tr> + <tr> + <td>{{RFC("5861")}}</td> + <td>HTTP Cache-Control Extensions for Stale Content</td> + </tr> + <tr> + <td>{{RFC("8246")}}</td> + <td>HTTP Immutable Responses</td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility">Browser compatibility</h2> + +<p class="hidden">The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p> + +<p>{{Compat("http.headers.Cache-Control")}}</p> + +<h2 id="See_also">See also</h2> + +<ul> + <li><a href="/en-US/docs/Web/HTTP/Caching_FAQ">HTTP Caching FAQ</a></li> + <li>{{HTTPHeader("Age")}}</li> + <li>{{HTTPHeader("Expires")}}</li> + <li>{{HTTPHeader("Pragma")}}</li> +</ul> diff --git a/files/pl/web/http/headers/data/index.html b/files/pl/web/http/headers/data/index.html new file mode 100644 index 0000000000..f348b4e839 --- /dev/null +++ b/files/pl/web/http/headers/data/index.html @@ -0,0 +1,81 @@ +--- +title: Data +slug: Web/HTTP/Headers/Data +translation_of: Web/HTTP/Headers/Date +--- +<div>{{HTTPSidebar}}</div> + +<p><strong><code>Date</code></strong> jest to ogólny nagłówek HTTP zawierający datę i czas w jakiej wiadomość została stworzona.</p> + +<table class="properties"> + <tbody> + <tr> + <th scope="row">Header type</th> + <td>{{Glossary("General header")}}</td> + </tr> + <tr> + <th scope="row">{{Glossary("Forbidden header name")}}</th> + <td>yes</td> + </tr> + </tbody> +</table> + +<h2 id="Składnia">Składnia</h2> + +<pre class="syntaxbox">Date: <day-name>, <day> <month> <year> <hour>:<minute>:<second> GMT +</pre> + +<h2 id="Dyrektywy">Dyrektywy</h2> + +<dl> + <dt><day-name></dt> + <dd>One of "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", or "Sun" (case-sensitive).</dd> + <dt><day></dt> + <dd>2 digit day number, e.g. "04" or "23".</dd> + <dt><month></dt> + <dd>One of "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" (case sensitive).</dd> + <dt><year></dt> + <dd>4 digit year number, e.g. "1990" or "2016".</dd> + <dt><hour></dt> + <dd>2 digit hour number, e.g. "09" or "23".</dd> + <dt><minute></dt> + <dd>2 digit minute number, e.g. "04" or "59".</dd> + <dt><second></dt> + <dd>2 digit second number, e.g. "04" or "59".</dd> + <dt>GMT</dt> + <dd> + <p>Greenwich Mean Time. HTTP dates are always expressed in GMT, never in local time.</p> + </dd> +</dl> + +<h2 id="Przykłady">Przykłady</h2> + +<pre>Date: Wed, 21 Oct 2015 07:28:00 GMT +</pre> + +<h2 id="Specyfikacja">Specyfikacja</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Specification</th> + <th scope="col">Title</th> + </tr> + <tr> + <td>{{RFC("7231", "Date", "7.1.1.2")}}</td> + <td>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</td> + </tr> + </tbody> +</table> + +<h2 id="Zgodność_z_przeglądarką"><span class="short_text" id="result_box" lang="pl"><span>Zgodność z przeglądarką</span></span></h2> + +<p class="hidden">Tabela kompatybilności na tej stronie jest generowana z danych strukturalnych. Jeżeli chcesz pomóc w dostarczeniu danch otwórz link: <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> i wyślij nam zapytanie.</p> + +<p>{{Compat("http.headers.Date")}}</p> + +<h2 id="Zobacz_również">Zobacz również</h2> + +<ul> + <li>{{HTTPHeader("Age")}}</li> +</ul> diff --git a/files/pl/web/http/headers/index.html b/files/pl/web/http/headers/index.html new file mode 100644 index 0000000000..9c8850dc38 --- /dev/null +++ b/files/pl/web/http/headers/index.html @@ -0,0 +1,374 @@ +--- +title: HTTP headers +slug: Web/HTTP/Headers +tags: + - HTTP + - Headers + - NeedsTranslation + - Networking + - Reference + - TopicStub +translation_of: Web/HTTP/Headers +--- +<div>{{HTTPSidebar}}</div> + +<p>HTTP headers allow the client and the server to pass additional information with the request or the response. A request header consists of its case-insensitive name followed by a colon '<code>:</code>', then by its value (without line breaks). Leading white space before the value is ignored.</p> + +<p>Custom proprietary headers can be added using the 'X-' prefix, but this convention was deprecated in June 2012, because of the inconveniences it caused when non-standard fields became standard in <a href="https://tools.ietf.org/html/rfc6648">RFC 6648</a>; others are listed in an <a class="external" href="http://www.iana.org/assignments/message-headers/perm-headers.html">IANA registry</a>, whose original content was defined in <a class="external" href="http://tools.ietf.org/html/rfc4229">RFC 4229</a>. IANA also maintains a <a class="external" href="http://www.iana.org/assignments/message-headers/prov-headers.html">registry of proposed new HTTP message headers</a>.</p> + +<p>Headers can be grouped according to their contexts:</p> + +<ul> + <li>{{Glossary("General header")}}: Headers applying to both requests and responses but with no relation to the data eventually transmitted in the body.</li> + <li>{{Glossary("Request header")}}: Headers containing more information about the resource to be fetched or about the client itself.</li> + <li>{{Glossary("Response header")}}: Headers with additional information about the response, like its location or about the server itself (name and version etc.).</li> + <li>{{Glossary("Entity header")}}: Headers containing more information about the body of the entity, like its content length or its MIME-type.</li> +</ul> + +<p>Headers can also be grouped according to how proxies handle them:</p> + +<dl> + <dt><a id="e2e" name="e2e"></a>End-to-end headers</dt> + <dd>These headers must be transmitted to the final recipient of the message; that is, the server for a request or the client for a response. Intermediate proxies must retransmit end-to-end headers unmodified and caches must store them.</dd> + <dt><a id="hbh" name="hbh"></a>Hop-by-hop headers</dt> + <dd>These headers are meaningful only for a single transport-level connection and must not be retransmitted by proxies or cached. Such headers are: {{ httpheader("Connection") }}, {{ httpheader("Keep-Alive") }}, {{ httpheader("Proxy-Authenticate") }}, {{ httpheader("Proxy-Authorization") }}, {{ httpheader("TE") }}, {{ httpheader("Trailer") }}, {{ httpheader("Transfer-Encoding") }} and {{ httpheader("Upgrade") }}. Note that only hop-by-hop headers may be set using the {{ httpheader("Connection") }} general header.</dd> +</dl> + +<p>The following list summarizes HTTP headers by their usage category. For an alphabetical list, see the navigation on the left side.</p> + +<h2 id="Authentication">Authentication</h2> + +<dl> + <dt>{{HTTPHeader("WWW-Authenticate")}}</dt> + <dd>Defines the authentication method that should be used to gain access to a resource.</dd> + <dt>{{HTTPHeader("Authorization")}}</dt> + <dd>Contains the credentials to authenticate a user agent with a server.</dd> + <dt>{{HTTPHeader("Proxy-Authenticate")}}</dt> + <dd>Defines the authentication method that should be used to gain access to a resource behind a Proxy server.</dd> + <dt>{{HTTPHeader("Proxy-Authorization")}}</dt> + <dd>Contains the credentials to authenticate a user agent with a proxy server.</dd> +</dl> + +<h2 id="Caching">Caching</h2> + +<dl> + <dt>{{HTTPHeader("Age")}}</dt> + <dd>The time in seconds the object has been in a proxy cache.</dd> + <dt>{{HTTPHeader("Cache-Control")}}</dt> + <dd>Specifies directives for caching mechanisms in both requests and responses.</dd> + <dt>{{HTTPHeader("Expires")}}</dt> + <dd>The date/time after which the response is considered stale.</dd> + <dt>{{HTTPHeader("Pragma")}}</dt> + <dd>Implementation-specific header that may have various effects anywhere along the request-response chain. Used for backwards compatibility with HTTP/1.0 caches where the <code>Cache-Control</code> header is not yet present.</dd> + <dt>{{HTTPHeader("Warning")}}</dt> + <dd>A general warning field containing information about possible problems.</dd> +</dl> + +<h2 id="Client_hints">Client hints</h2> + +<dl> + <dt>{{HTTPHeader("Accept-CH")}}</dt> + <dd>...</dd> + <dt>{{HTTPHeader("Content-DPR")}}</dt> + <dd>...</dd> + <dt>{{HTTPHeader("DPR")}}</dt> + <dd>...</dd> + <dt>{{HTTPHeader("Downlink")}}</dt> + <dd>...</dd> + <dt>{{HTTPHeader("Save-Data")}}</dt> + <dd>...</dd> + <dt>{{HTTPHeader("Viewport-Width")}}</dt> + <dd>...</dd> + <dt>{{HTTPHeader("Width")}}</dt> + <dd>...</dd> +</dl> + +<dl> + <dt> + <h2 id="Conditionals">Conditionals</h2> + </dt> + <dt>{{HTTPHeader("Last-Modified")}}</dt> + <dd>It is a validator, the last modification date of the resource, used to compare several versions of the same resource. It is less accurate than {{HTTPHeader("ETag")}}, but easier to calculate in some environments. Conditional requests using {{HTTPHeader("If-Modified-Since")}} and {{HTTPHeader("If-Unmodified-Since")}} use this value to change the behavior of the request.</dd> + <dt>{{HTTPHeader("ETag")}}</dt> + <dd>It is a validator, a unique string identifying the version of the resource. Conditional requests using {{HTTPHeader("If-Match")}} and {{HTTPHeader("If-None-Match")}} use this value to change the behavior of the request.</dd> + <dt>{{HTTPHeader("If-Match")}}</dt> + <dd>Makes the request conditional and applies the method only if the stored resource matches one of the given ETags.</dd> + <dt>{{HTTPHeader("If-None-Match")}}</dt> + <dd>Makes the request conditional and applies the method only if the stored resource doesn't match any of the given ETags. This is used to update caches (for safe requests), or to prevent to upload a new resource when one is already existing.</dd> + <dt>{{HTTPHeader("If-Modified-Since")}}</dt> + <dd>Makes the request conditional and expects the entity to be transmitted only if it has been modified after the given date. This is used to transmit data only when the cache is out of date.</dd> + <dt>{{HTTPHeader("If-Unmodified-Since")}}</dt> + <dd>Makes the request conditional and expects the entity to be transmitted only if it has not been modified after the given date. This is used to ensure the coherence of a new fragment of a specific range with previous ones, or to implement an optimistic concurrency control system when modifying existing documents.</dd> +</dl> + +<h2 id="Connection_management">Connection management</h2> + +<dl> + <dt>{{HTTPHeader("Connection")}}</dt> + <dd>Controls whether the network connection stays open after the current transaction finishes.</dd> + <dt>{{HTTPHeader("Keep-Alive")}}</dt> + <dd>Controls how long a persistent connection should stay open.</dd> +</dl> + +<h2 id="Content_negotiation">Content negotiation</h2> + +<dl> + <dt>{{HTTPHeader("Accept")}}</dt> + <dd>Informs the server about the types of data that can be sent back. It is MIME-type.</dd> + <dt>{{HTTPHeader("Accept-Charset")}}</dt> + <dd>Informs the server about which character set the client is able to understand.</dd> + <dt>{{HTTPHeader("Accept-Encoding")}}</dt> + <dd>Informs the server about the encoding algorithm, usually a compression algorithm, that can be used on the resource sent back.</dd> + <dt>{{HTTPHeader("Accept-Language")}}</dt> + <dd>Informs the server about the language the server is expected to send back. This is a hint and is not necessarily under the full control of the user: the server should always pay attention not to override an explicit user choice (like selecting a language in a drop down list).</dd> +</dl> + +<dl> +</dl> + +<h2 id="Controls">Controls</h2> + +<dl> + <dt>{{HTTPHeader("Expect")}}</dt> + <dd>Indicates expectations that need to be fulfilled by the server in order to properly handle the request.</dd> + <dt>{{HTTPHeader("Max-Forwards")}}</dt> + <dd>...</dd> +</dl> + +<h2 id="Cookies">Cookies</h2> + +<dl> + <dt>{{HTTPHeader("Cookie")}}</dt> + <dd>Contains stored <a href="/en-US/docs/Web/HTTP/Cookies">HTTP cookies</a> previously sent by the server with the {{HTTPHeader("Set-Cookie")}} header.</dd> + <dt>{{HTTPHeader("Set-Cookie")}}</dt> + <dd>Send cookies from the server to the user agent.</dd> + <dt>{{HTTPHeader("Cookie2")}} {{obsolete_inline}}</dt> + <dd>Used to contain an HTTP cookie, previously sent by the server with the {{HTTPHeader("Set-Cookie2")}} header, but has been obsoleted by the specification. Use {{HTTPHeader("Cookie")}} instead.</dd> + <dt>{{HTTPHeader("Set-Cookie2")}} {{obsolete_inline}}</dt> + <dd>Used to send cookies from the server to the user agent, but has been obsoleted by the specification. Use {{HTTPHeader("Set-Cookie")}} instead.</dd> + <dt> + <h2 id="CORS">CORS</h2> + </dt> + <dt>{{HTTPHeader("Access-Control-Allow-Origin")}}</dt> + <dd>Indicates whether the response can be shared.</dd> + <dt>{{HTTPHeader("Access-Control-Allow-Credentials")}}</dt> + <dd>Indicates whether the response to the request can be exposed when the credentials flag is true.</dd> + <dt>{{HTTPHeader("Access-Control-Allow-Headers")}}</dt> + <dd>Used in response to a preflight request to indicate which HTTP headers can be used when making the actual request.</dd> + <dt>{{HTTPHeader("Access-Control-Allow-Methods")}}</dt> + <dd>Specifies the method or methods allowed when accessing the resource in response to a preflight request.</dd> + <dt>{{HTTPHeader("Access-Control-Expose-Headers")}}</dt> + <dd>Indicates which headers can be exposed as part of the response by listing their names.</dd> + <dt>{{HTTPHeader("Access-Control-Max-Age")}}</dt> + <dd>Indicates how long the results of a preflight request can be cached.</dd> + <dt>{{HTTPHeader("Access-Control-Request-Headers")}}</dt> + <dd>Used when issuing a preflight request to let the server know which HTTP headers will be used when the actual request is made.</dd> + <dt>{{HTTPHeader("Access-Control-Request-Method")}}</dt> + <dd>Used when issuing a preflight request to let the server know which <a href="/en-US/docs/Web/HTTP/Methods">HTTP method</a> will be used when the actual request is made.</dd> + <dt>{{HTTPHeader("Origin")}}</dt> + <dd>Indicates where a fetch originates from.</dd> + <dt>{{HTTPHeader("Timing-Allow-Origin")}}</dt> + <dd>Specifies origins that are allowed to see values of attributes retrieved via features of the <a href="/en-US/docs/Web/API/Resource_Timing_API">Resource Timing API</a>, which would otherwise be reported as zero due to cross-origin restrictions.</dd> +</dl> + +<h2 id="Do_Not_Track">Do Not Track</h2> + +<dl> + <dt>{{HTTPHeader("DNT")}}</dt> + <dd>Used for expressing the user's tracking preference.</dd> + <dt>{{HTTPHeader("Tk")}}</dt> + <dd>Indicates the tracking status that applied to the corresponding request.</dd> +</dl> + +<h2 id="Downloads">Downloads</h2> + +<dl> + <dt>{{HTTPHeader("Content-Disposition")}}</dt> + <dd>Is a response header if the resource transmitted should be displayed inline (default behavior when the header is not present), or it should be handled like a download and the browser should present a 'Save As' window.</dd> +</dl> + +<h2 id="Message_body_information">Message body information</h2> + +<dl> + <dt>{{HTTPHeader("Content-Length")}}</dt> + <dd>indicates the size of the entity-body, in decimal number of octets, sent to the recipient.</dd> + <dt>{{HTTPHeader("Content-Type")}}</dt> + <dd>Indicates the media type of the resource.</dd> + <dt>{{HTTPHeader("Content-Encoding")}}</dt> + <dd>Used to specify the compression algorithm.</dd> + <dt>{{HTTPHeader("Content-Language")}}</dt> + <dd>Describes the language(s) intended for the audience, so that it allows a user to differentiate according to the users' own preferred language.</dd> + <dt>{{HTTPHeader("Content-Location")}}</dt> + <dd>Indicates an alternate location for the returned data.</dd> + <dt> + <h2 id="Proxies">Proxies</h2> + </dt> +</dl> + +<dl> + <dt>{{HTTPHeader("Forwarded")}}</dt> + <dd>Contains information from the client-facing side of proxy servers that is altered or lost when a proxy is involved in the path of the request.</dd> + <dt>{{HTTPHeader("X-Forwarded-For")}} {{non-standard_inline}}</dt> + <dd>Identifies the originating IP addresses of a client connecting to a web server through an HTTP proxy or a load balancer.</dd> + <dt>{{HTTPHeader("X-Forwarded-Host")}} {{non-standard_inline}}</dt> + <dd>Identifies the original host requested that a client used to connect to your proxy or load balancer.</dd> + <dt>{{HTTPHeader("X-Forwarded-Proto")}} {{non-standard_inline}}</dt> + <dd>identifies the protocol (HTTP or HTTPS) that a client used to connect to your proxy or load balancer.</dd> + <dt>{{HTTPHeader("Via")}}</dt> + <dd>Added by proxies, both forward and reverse proxies, and can appear in the request headers and the response headers.</dd> +</dl> + +<h2 id="Redirects">Redirects</h2> + +<dl> + <dt>{{HTTPHeader("Location")}}</dt> + <dd>Indicates the URL to redirect a page to.</dd> +</dl> + +<h2 id="Request_context">Request context</h2> + +<dl> + <dt>{{HTTPHeader("From")}}</dt> + <dd>Contains an Internet email address for a human user who controls the requesting user agent.</dd> + <dt>{{HTTPHeader("Host")}}</dt> + <dd>Specifies the domain name of the server (for virtual hosting), and (optionally) the TCP port number on which the server is listening.</dd> + <dt>{{HTTPHeader("Referer")}}</dt> + <dd>The address of the previous web page from which a link to the currently requested page was followed.</dd> + <dt>{{HTTPHeader("Referrer-Policy")}}</dt> + <dd>Governs which referrer information sent in the {{HTTPHeader("Referer")}} header should be included with requests made.</dd> + <dt>{{HTTPHeader("User-Agent")}}</dt> + <dd>Contains a characteristic string that allows the network protocol peers to identify the application type, operating system, software vendor or software version of the requesting software user agent. See also the <a href="/en-US/docs/Web/HTTP/Headers/User-Agent/Firefox">Firefox user agent string reference</a>.</dd> +</dl> + +<h2 id="Response_context">Response context</h2> + +<dl> + <dt>{{HTTPHeader("Allow")}}</dt> + <dd>Lists the set of HTTP request methods support by a resource.</dd> + <dt>{{HTTPHeader("Server")}}</dt> + <dd>Contains information about the software used by the origin server to handle the request.</dd> +</dl> + +<h2 id="Range_requests">Range requests</h2> + +<dl> + <dt>{{HTTPHeader("Accept-Ranges")}}</dt> + <dd>Indicates if the server supports range requests and if so, in which unit the range can be expressed.</dd> + <dt>{{HTTPHeader("Range")}}</dt> + <dd>Indicates the part of a document that the server should return.</dd> + <dt>{{HTTPHeader("If-Range")}}</dt> + <dd>Creates a conditional range request that is only fulfilled if the given etag or date matches the remote resource. Used to prevent downloading two ranges from incompatible version of the resource.</dd> + <dt>{{HTTPHeader("Content-Range")}}</dt> + <dd>Indicates where in a full body message a partial message belongs.</dd> +</dl> + +<h2 id="Security">Security</h2> + +<dl> + <dt>{{HTTPHeader("Content-Security-Policy")}} ({{Glossary("CSP")}})</dt> + <dd>Controls resources the user agent is allowed to load for a given page.</dd> + <dt>{{HTTPHeader("Content-Security-Policy-Report-Only")}}</dt> + <dd>Allows web developers to experiment with policies by monitoring (but not enforcing) their effects. These violation reports consist of {{Glossary("JSON")}} documents sent via an HTTP <code>POST</code> request to the specified URI.</dd> + <dt>{{HTTPHeader("Expect-CT")}}</dt> + <dd>Allows sites to opt in to reporting and/or enforcement of Certificate Transparency requirements, which prevents the use of misissued certificates for that site from going unnoticed. When a site enables the Expect-CT header, they are requesting that Chrome check that any certificate for that site appears in public CT logs.</dd> + <dt>{{HTTPHeader("Public-Key-Pins")}} ({{Glossary("HPKP")}})</dt> + <dd>Associates a specific cryptographic public key with a certain web server to decrease the risk of {{Glossary("MITM")}} attacks with forged certificates.</dd> + <dt>{{HTTPHeader("Public-Key-Pins-Report-Only")}}</dt> + <dd>Sends reports to the report-uri specified in the header and does still allow clients to connect to the server even if the pinning is violated.</dd> +</dl> + +<dl> + <dt>{{HTTPHeader("Strict-Transport-Security")}} ({{Glossary("HSTS")}})</dt> + <dd>Force communication using HTTPS instead of HTTP.</dd> + <dt>{{HTTPHeader("Upgrade-Insecure-Requests")}}</dt> + <dd>Sends a signal to the server expressing the client’s preference for an encrypted and authenticated response, and that it can successfully handle the {{CSP("upgrade-insecure-requests")}} directive.</dd> +</dl> + +<dl> + <dt>{{HTTPHeader("X-Content-Type-Options")}}</dt> + <dd>Disables MIME sniffing and forces browser to use the type given in {{HTTPHeader("Content-Type")}}.</dd> +</dl> + +<dl> + <dt>{{HTTPHeader("X-Frame-Options")}} (XFO)</dt> + <dd>Indicates whether a browser should be allowed to render a page in a {{HTMLElement("frame")}}, {{HTMLElement("iframe")}} or {{HTMLElement("object")}}</dd> + <dt>{{HTTPHeader("X-XSS-Protection")}}</dt> + <dd>Enables cross-site scripting filtering.</dd> +</dl> + +<h2 id="Server-sent_events">Server-sent events</h2> + +<dl> + <dt>{{HTTPHeader("Ping-From")}}</dt> + <dd>...</dd> + <dt>{{HTTPHeader("Ping-To")}}</dt> + <dd>...</dd> + <dt>{{HTTPHeader("Last-Event-ID")}}</dt> + <dd>...</dd> +</dl> + +<h2 id="Transfer_coding">Transfer coding</h2> + +<dl> + <dt>{{HTTPHeader("Transfer-Encoding")}}</dt> + <dd>Specifies the the form of encoding used to safely transfer the entity to the user.</dd> + <dt>{{HTTPHeader("TE")}}</dt> + <dd>Specifies the transfer encodings the user agent is willing to accept.</dd> + <dt>{{HTTPHeader("Trailer")}}</dt> + <dd>Allows the sender to include additional fields at the end of chunked message.</dd> +</dl> + +<h2 id="WebSockets">WebSockets</h2> + +<dl> + <dt>{{HTTPHeader("Sec-WebSocket-Key")}}</dt> + <dd>...</dd> + <dt>{{HTTPHeader("Sec-WebSocket-Extensions")}}</dt> + <dd>...</dd> + <dt>{{HTTPHeader("Sec-WebSocket-Accept")}}</dt> + <dd>...</dd> + <dt>{{HTTPHeader("Sec-WebSocket-Protocol")}}</dt> + <dd>...</dd> + <dt>{{HTTPHeader("Sec-WebSocket-Version")}}</dt> + <dd>...</dd> +</dl> + +<h2 id="Other">Other</h2> + +<dl> + <dt>{{HTTPHeader("Date")}}</dt> + <dd>Contains the date and time at which the message was originated.</dd> + <dt>{{HTTPHeader("Expect-CT")}}</dt> + <dd>Allows sites to opt in to reporting and/or enforcement of Certificate Transparency requirements.</dd> + <dt>{{HTTPHeader("Large-Allocation")}}</dt> + <dd>Tells the browser that the page being loaded is going to want to perform a large allocation.</dd> + <dt>{{HTTPHeader("Link")}}</dt> + <dd>...</dd> + <dt>{{HTTPHeader("Retry-After")}}</dt> + <dd>Indicates how long the user agent should wait before making a follow-up request.</dd> + <dt>{{HTTPHeader("SourceMap")}}</dt> + <dd>Links generated code to a <a href="/en-US/docs/Tools/Debugger/How_to/Use_a_source_map">source map</a>.</dd> + <dt>{{HTTPHeader("Upgrade")}}</dt> + <dd>The relevant RFC document for the <a href="https://tools.ietf.org/html/rfc7230#section-6.7">Upgrade header field is RFC 7230, section 6.7</a>. The standard establishes rules for upgrading or changing to a different protocol on the current client, server, transport protocol connection. For example, this header standard allows a client to change from HTTP 1.1 to HTTP 2.0, assuming the server decides to acknowledge and implement the Upgrade header field. Neither party is required to accept the terms specified in the Upgrade header field. It can be used in both client and server headers. If the Upgrade header field is specified, then the sender MUST also send the Connection header field with the upgrade option specified. For details on the Connection header field <a href="https://tools.ietf.org/html/rfc7230#section-6.1">please see section 6.1 of the aforementioned RFC</a>.</dd> + <dt>{{HTTPHeader("Vary")}}</dt> + <dd>Determines how to match future request headers to decide whether a cached response can be used rather than requesting a fresh one from the origin server.</dd> + <dt>{{HTTPHeader("X-DNS-Prefetch-Control")}}</dt> + <dd>Controls DNS prefetching, a feature by which browsers proactively perform domain name resolution on both links that the user may choose to follow as well as URLs for items referenced by the document, including images, CSS, JavaScript, and so forth.</dd> + <dt>{{HTTPHeader("X-Firefox-Spdy")}}</dt> + <dd>...</dd> + <dt>{{HTTPHeader("X-Requested-With")}}</dt> + <dd>...</dd> + <dt>{{HTTPHeader("X-UA-Compatible")}}</dt> + <dd>...</dd> +</dl> + +<h2 id="Contributing">Contributing</h2> + +<p>You can help by <a href="/en-US/docs/MDN/Contribute/Howto/Document_an_HTTP_header">writing new entries</a> or improving the existing ones.</p> + +<h2 id="See_also">See also</h2> + +<ul> + <li><a href="https://en.wikipedia.org/wiki/List_of_HTTP_header_fields">Wikipedia page on List of HTTP headers</a></li> + <li><a href="https://www.iana.org/assignments/message-headers/perm-headers.html">IANA registry</a></li> +</ul> diff --git a/files/pl/web/http/headers/referrer-policy/index.html b/files/pl/web/http/headers/referrer-policy/index.html new file mode 100644 index 0000000000..186868538e --- /dev/null +++ b/files/pl/web/http/headers/referrer-policy/index.html @@ -0,0 +1,260 @@ +--- +title: Zasada Polecającego (Referrer-Policy) +slug: Web/HTTP/Headers/Referrer-Policy +tags: + - HTTP + - Reference + - Referencja + - Referrer-Policy + - Response + - Response Header + - nagłówek HTTP + - nagłówek odpowiedzi + - odpowiedź + - polecający + - prywatność + - referrer + - zasada polecającego +translation_of: Web/HTTP/Headers/Referrer-Policy +--- +<div>{{HTTPSidebar}}</div> + +<p><span class="seoSummary">{{glossary("HTTP header")}} <strong><code>Referrer-Policy</code></strong> kontroluje, w jakim zakresie <a href="/en-US/docs/Web/Security/Referer_header:_privacy_and_security_concerns">informacje dot. polecającego (referrera)</a> (wysyłane poprzez nagłówek {{HTTPHeader("Referer")}}) powinny być zawarte w żądaniu</span></p> + +<table class="properties"> + <tbody> + <tr> + <th scope="row">Typ nagłówka</th> + <td>{{Glossary("Response header")}}</td> + </tr> + <tr> + <th scope="row">{{Glossary("Forbidden header name")}}</th> + <td>nie</td> + </tr> + </tbody> +</table> + +<h2 id="Składnia">Składnia</h2> + +<div class="blockIndicator note"> +<p>Originalna nazwa nagłówka, {{HTTPHeader("Referer")}}, to błędnie zapisane słowo "referrer" ("polecający"). Nagłówek <code>Referrer-Policy</code> nie zawiera tej literówki.</p> +</div> + +<pre class="syntaxbox">Referrer-Policy: no-referrer +Referrer-Policy: no-referrer-when-downgrade +Referrer-Policy: origin +Referrer-Policy: origin-when-cross-origin +Referrer-Policy: same-origin +Referrer-Policy: strict-origin +Referrer-Policy: strict-origin-when-cross-origin +Referrer-Policy: unsafe-url +</pre> + +<h2 id="Dyrektywy">Dyrektywy</h2> + +<dl> + <dt><code>no-referrer</code></dt> + <dd>Nagłówek {{HTTPHeader("Referer")}} zostanie całkowicie pominięty. Żadna informacja dot. polecającego nie zostanie wysłana w żądaniu.</dd> + <dt><code>no-referrer-when-downgrade</code> (domyślna)</dt> + <dd>Zachowanie domyślne, jeśli zasada nie została określona lub jeśli wartość jest niepoprawna. {{glossary("origin")}}, {{glossary("path")}} oraz {{glossary("querystring")}} URLu są wysyłane jako polecający, podczas gdy poziom bezpieczeństwa protokołu pozostaje na tym samym poziomie (HTTP→HTTP, HTTPS→HTTPS) lub jest bezpieczniejszy (HTTP→HTTPS), ale nie gdy destynacja jest mniej bezpieczna (HTTPS→HTTP).</dd> + <dt><code>origin</code></dt> + <dd>Wysyła jedynie {{glossary("origin")}} dokumentu jako jego polecającego. Przykładowo, dokument pod adresem <code>https://example.com/page.html</code> wyśle referrer brzmiący: <code>https://example.com/</code>.</dd> + <dt><code>origin-when-cross-origin</code></dt> + <dd>Wyśle origin, ścieżkę i string z zapytaniem podczas obsługi żądania {{glossary("Same-origin_policy", "same-origin")}}, w innych przypadkach wyśle jedynie origin dokumentu.</dd> + <dt><code>same-origin</code></dt> + <dd>Referrer zostanie wysłany do <a href="/en-US/docs/Web/Security/Same-origin_policy">originów same-site</a>, natomiast żądania cross-origin nie będą zawierać informacji o referrerze.</dd> + <dt><code>strict-origin</code></dt> + <dd>Wyśle origin dokumentu jako referrer, jeśli poziom bezpieczeństwa protokołu zostaje na tym samym poziomie (HTTPS→HTTPS), nie wyśle, jeśli poziom bezpieczeństwa destynacji jest niższy (HTTPS→HTTP).</dd> + <dt><code>strict-origin-when-cross-origin</code></dt> + <dd>Wyśle origin, ścieżkę i string z zapytaniem podczas obsługi żądania same-orign, wyśle jedynie origin, jeśli poziom bezpieczeństwa protokołu pozostaje taki sam (HTTPS→HTTPS), natomiast nie wyśle nagłówka do destynacji o niższym poziomie bezpieczeństwa (HTTPS→HTTP).</dd> + <dt><code>unsafe-url</code></dt> + <dd>Wyśle origin, ścieżkę i string z zapytaniem podczas obsługi jakiegokolwiek zdarzenia, niezależnie od bezpieczeństwa. + <div class="blockIndicator warning"> + <p>Niniejsza zasada może skutkować wyciekiem potencjalnie prywatnych informacji z URLów zasobów HTTPS do niebezpiecznych originów. Mocno się zastanów, zanim wybierzesz to ustawienie.</p> + </div> + </dd> +</dl> + +<h2 id="Integracja_z_HTMLem">Integracja z HTMLem</h2> + +<p>Możesz ustawić zasady polecającego także w HTMLu. Przykładowo, możesz ustawić zasadę polecającego dla całego dokumentu poprzez konfigurację elementu {{HTMLElement("meta")}} z <a href="/en-US/docs/Web/HTML/Element/meta#attr-name">name </a>równe <a href="/en-US/docs/Web/HTML/Element/meta#attr-name"><code>referrer</code></a>:</p> + +<pre class="brush: html"><meta name="referrer" content="origin"></pre> + +<p>Lub ustawić dla określonych żądań poprzez atrybut <code>referrerpolicy</code> na elementach {{HTMLElement("a")}}, {{HTMLElement("area")}}, {{HTMLElement("img")}}, {{HTMLElement("iframe")}}, {{HTMLElement("script")}} czy {{HTMLElement("link")}}:</p> + +<pre class="brush: html"><a href="http://example.com" referrerpolicy="origin"></pre> + +<p>Alternatywnie, w przypadku elementu <code>a</code>, <code>area</code>, bądź <code>link</code> możesz ustawić <a href="/en-US/docs/Web/HTML/Link_types">relację linku</a> na <code>noreferrer</code> :</p> + +<pre class="brush: html"><a href="http://example.com" rel="noreferrer"></pre> + +<h2 id="Integracja_z_CSSem">Integracja z CSSem</h2> + +<p>CSS może przechwytywać zasoby wyszczególnione w arkuszach stylów. Niniejsze zasoby również podlegają zasadzie polecającego:</p> + +<ul> + <li>Zewnętrzne arkusze stylów CSS używają domyślnej zasady (<code>no-referrer-when-downgrade</code>) chyba, że jest nadpisana przez nagłówek HTTP <code>Referrer-Policy</code> w odpowiedzi arkusza stylów CSS.</li> + <li>Dla elementów {{HTMLElement("style")}} lub<a href="/en-US/docs/Web/API/HTMLElement/style"> atrybutów</a> <a href="/en-US/docs/Web/API/HTMLElement/style"><code>style</code></a> aplikowana jest zasada właściciela dokumentu.</li> +</ul> + +<h2 id="Przykłady">Przykłady</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Zasada</th> + <th scope="col">Document</th> + <th scope="col">Nawigacja do</th> + <th scope="col">Referrer</th> + </tr> + </thead> + <tbody> + <tr> + <th><code>no-referrer</code></th> + <td>https://example.com/page</td> + <td><em>gdziekolwiek</em></td> + <td><em>(no referrer)</em></td> + </tr> + <tr> + <th rowspan="3"><code>no-referrer-when-downgrade</code></th> + <td rowspan="3">https://example.com/page</td> + <td>https://example.com/otherpage</td> + <td>https://example.com/page</td> + </tr> + <tr> + <td>https://mozilla.org</td> + <td>https://example.com/page</td> + </tr> + <tr> + <td><strong>http</strong>://example.org</td> + <td><em>(no referrer)</em></td> + </tr> + <tr> + <th><code>origin</code></th> + <td>https://example.com/page</td> + <td><em>anywhere</em></td> + <td>https://example.com/</td> + </tr> + <tr> + <th rowspan="3"><code>origin-when-cross-origin</code></th> + <td rowspan="3">https://example.com/page</td> + <td>https://example.com/otherpage</td> + <td>https://example.com/page</td> + </tr> + <tr> + <td>https://mozilla.org</td> + <td>https://example.com/</td> + </tr> + <tr> + <td><strong>http</strong>://example.com/page</td> + <td>https://example.com/</td> + </tr> + <tr> + <th rowspan="2"><code>same-origin</code></th> + <td rowspan="2">https://example.com/page</td> + <td>https://example.com/otherpage</td> + <td>https://example.com/page</td> + </tr> + <tr> + <td>https://mozilla.org</td> + <td><em>(no referrer)</em></td> + </tr> + <tr> + <th rowspan="3"><code>strict-origin</code></th> + <td rowspan="2">https://example.com/page</td> + <td>https://mozilla.org</td> + <td>https://example.com/</td> + </tr> + <tr> + <td><strong>http</strong>://example.org</td> + <td><em>(no referrer)</em></td> + </tr> + <tr> + <td><strong>http</strong>://example.com/page</td> + <td><em>anywhere</em></td> + <td>http://example.com/</td> + </tr> + <tr> + <th rowspan="3"><code>strict-origin-when-cross-origin</code></th> + <td rowspan="3">https://example.com/page</td> + <td>https://example.com/otherpage</td> + <td>https://example.com/page</td> + </tr> + <tr> + <td>https://mozilla.org</td> + <td>https://example.com/</td> + </tr> + <tr> + <td><strong>http</strong>://example.org</td> + <td><em>(no referrer)</em></td> + </tr> + <tr> + <th><code>unsafe-url</code></th> + <td>https://example.com/page?q=123</td> + <td><em>anywhere</em></td> + <td>https://example.com/page?q=123</td> + </tr> + </tbody> +</table> + +<h3 id="Określanie_zasady_awaryjnej">Określanie zasady awaryjnej</h3> + +<p>Jeśli chcesz określić zasadę awaryjną na wypadek, gdy pożądana zasada nie jest wspierana przez daną przeglądarkę, użyj listy oddzielonej przecinkiem, gdzie na samym końcu wpisujesz pożądaną zasadę:</p> + +<pre><code>Referrer-Policy: no-referrer, strict-origin-when-cross-origin</code></pre> + +<p>W przypadku powyższego scenariusza, <code>no-referrer</code> zostanie użyty jedynie, jeśli <code>strict-origin-when-cross-origin</code> nie jest wspierany przez daną przeglądarkę.</p> + +<p class="note">Określanie wielu wartości jest wspierane jedynie w nagłówku HTTP <code>Referrer-Policy</code>, nie jest natomiast w atrybucie <code>referrerpolicy</code>.</p> + +<h2 id="Specyfikacje">Specyfikacje</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Specyfikacja</th> + <th scope="col">Status</th> + </tr> + </thead> + <tbody> + <tr> + <td><a href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-header">Zasada Referrera </a></td> + <td>Wersja robocza redaktora</td> + </tr> + </tbody> +</table> + +<h2 id="Kompatybilność_z_przeglądarkami">Kompatybilność z przeglądarkami</h2> + +<div class="hidden">Tabela kompatybilności na tej stronie jest generowana z danych strukturalnych. Jeśli chcesz mieć swój wkład w tworzenie tych danych, sprawdź <a class="external" href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> i wyślij nam żądanie pull.</div> + +<p>{{Compat("http.headers.Referrer-Policy")}}</p> + +<div class="note"> +<ul> + <li>Od wersji 53 w górę, Gecko posiada preferencję dostępną w <code>about:config</code>, by móc pozwolić użytkownikom na ustawienie ich domyślnego <code>Referrer-Policy</code> — <span class="quote"> <code>network.http.referer.userControlPolicy</code>.</span></li> + <li>Od wersji 59 w górę (Zobacz: <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=587523">#587523</a>), zastąpiono ją przez <code>network.http.referer.defaultPolicy</code> oraz <code>network.http.referer.defaultPolicy.pbmode</code>.</li> +</ul> + +<p>Dopuszczalne wartości to:</p> + +<ul> + <li>0 — <code>no-referrer</code></li> + <li>1 — <code>same-origin</code></li> + <li>2 — <code>strict-origin-when-cross-origin</code></li> + <li>3 — <code>no-referrer-when-downgrade</code> (domyślna)</li> +</ul> +</div> + +<h2 id="Zobacz_również">Zobacz również</h2> + +<ul> + <li>{{interwiki("wikipedia", "HTTP_referer", "HTTP referer on Wikipedia")}}</li> + <li>Kiedy używać <a href="/en-US/docs/Web/API/Fetch_API">Fetch</a>: {{domxref("Request.referrerPolicy")}}</li> + <li>Przestarzała dyrektywa <span style="white-space: nowrap;">{{HTTPHeader("Content-Security-Policy")}}</span> {{HTTPHeader("Content-Security-Policy/referrer", "referrer")}} {{Obsolete_Inline}}</li> + <li><a href="/en-US/docs/Web/Security/Same-origin_policy">Zasada same-origin</a></li> + <li> + <p><a href="https://blog.mozilla.org/security/2015/01/21/meta-referrer/">Tighter Control Over Your Referrers – Mozilla Security Blog</a></p> + </li> +</ul> |