X powered by что это
HTTP response headers provide additional information about the server’s response to an HTTP request. These headers are essential for web developers and server administrators to ensure efficient and secure communication between clients and servers. In this blog post, we will discuss some of the most common HTTP response headers and provide example values for each header.
An response header example in Chrome
Response Headers
Content-Type
This header specifies the MIME type of the content being sent in the response. The MIME type tells the browser or other client how to interpret the content. For example, if the Content-Type is set to “text/html”, the browser knows to display the response as an HTML document. Other common MIME types include “application/json” for JSON data and “image/png” for PNG images.
Example 1: Content-Type: text/html
Example 2: Content-Type: application/json
Example 3: Content-Type: image/png
Cache-Control
This header specifies how the response should be cached. The value can include directives such as “public” to allow caching by any client, “private” to limit caching to the browser or other client, “no-cache” to indicate that the response should not be cached, and “max-age” to specify how long the response can be cached.
Example 1: Cache-Control: max-age=3600, public
Example 2: Cache-Control: no-cache
Example 3: Cache-Control: must-revalidate
Location
This header is used to redirect the client to a different URL. The client should automatically follow the URL in the Location header. This is commonly used for HTTP redirects, such as when a user submits a form and is redirected to a confirmation page.
Example 1: Location: https://www.example.com/newpage
Example 2: Location: /error.html
Example 3: Location: https://www.example.com/redirected
Set-Cookie
This header is used to set a cookie in the client’s browser. Cookies are small pieces of data that can be used to store information about the user or their session. The Set-Cookie header can include a name, value, expiration date, and other parameters.
Example 1: Set-Cookie: sessionId=12345; Expires=Thu, 01 Jan 2024 00:00:00 GMT
Example 2: Set-Cookie: userId=67890; Secure; HttpOnly
Example 3: Set-Cookie: preference=darkmode; Domain=example.com
Server
This header identifies the web server software being used to serve the response. The value of the header typically includes the name and version of the server software.
Example 1: Server: Apache/2.4.41 (Unix)
Example 2: Server: Microsoft-IIS/10.0
Example 3: Server: nginx/1.21.0
Expires
This header specifies the date and time after which the response should be considered stale. If a client requests the same resource before the expiration date has passed, the server can return a cached copy of the resource.
Example 1: Expires: Sat, 08 May 2023 12:00:00 GMT
Example 2: Expires: 0
Example 3: Expires: Thu, 01 Jan 1970 00:00:00 GMT
Content-Length
This header specifies the length of the content being sent in the response. This can be useful for the client to know how much data to expect and for the server to know how much data to send. When you are downloading a file from internet, the broweser looks at this header to determine how big the file is.
Example 1: Content-Length: 1024
Example 2: Content-Length: 2048
Example 3: Content-Length: 4096
Last-Modified
This header specifies the date and time when the content being sent in the response was last modified. This can be used by clients to determine if the resource has changed since it was last requested.
Example 1: Last-Modified: Tue, 04 May 2023 16:00:00 GMT
Example 2: Last-Modified: Wed, 03 May 2023 10:30:00 GMT
Example 3: Last-Modified: Mon, 01 May 2023 00:00:00 GMT
This header provides a unique identifier for the content being sent in the response. This can be used by clients to determine if the resource has changed since it was last requested, without having to download the entire resource again.
Example 1: ETag: «abc123»
Example 2: ETag: «xyz789»
Example 3: ETag: «efg456»
Access-Control-Allow-Origin
This header is used to specify which domains are allowed to access the resource being requested, in the case of cross-origin requests. This can help prevent malicious scripts from accessing resources that they should not have access to.
Example 1: Access-Control-Allow-Origin: https://www.example.com
Example 2: Access-Control-Allow-Origin: *
Example 3: Access-Control-Allow-Origin: https://api.example.com
X-Frame-Options
This header is used to prevent clickjacking attacks by restricting which sites are allowed to embed the page in an iframe. The value of the header can include “deny” to prevent embedding on any site, “sameorigin” to allow embedding only on the same domain, or a specific domain to allow embedding on that domain only.
Example 1: X-Frame-Options: SAMEORIGIN
Example 2: X-Frame-Options: DENY
Example 3: X-Frame-Options: ALLOW-FROM https://www.example.com
X-XSS-Protection
This header is used to enable or disable cross-site scripting (XSS) protection in the client’s browser. The value of the header can include “1” to enable protection or “0” to disable it.
Example 1: X-XSS-Protection: 1; mode=block
Example 2: X-XSS-Protection: 0
Example 3: X-XSS-Protection: 1; report=https://www.example.com/report
Referrer-Policy
This header is used to control how much information is sent in the referrer header when a user clicks on a link. The value of the header can include “no-referrer” to send no referrer information, “same-origin” to send referrer information only for same-origin requests, or “strict-origin” to send referrer information only for requests to the same domain.
Example 1: Referrer-Policy: strict-origin-when-cross-origin
Example 2: Referrer-Policy: no-referrer
Example 3: Referrer-Policy: origin
X-Forwarded-For
This header is used to identify the original IP address of a client that is connecting to a web server through a proxy or load balancer. When a request passes through a proxy or load balancer, the IP address of the client is usually replaced with the IP address of the proxy or load balancer. By setting this header, the proxy or load balancer can add the original IP address of the client to the request headers, allowing the server to identify the client.
Example 1: X-Forwarded-For: 192.168.1.1
Example 2: X-Forwarded-For: 192.168.1.1, 10.0.0.1
Example 3: X-Forwarded-For: 192.168.1.1, 10.0.0.1, 172.16.0.1
X-Powered-By
This header identifies the technology stack or software used to generate the response. While this header can provide useful information for developers and system administrators, it can also be a security risk if it reveals sensitive information about the server. For this reason, it is often recommended to remove this header or obfuscate its value.
Example 1: X-Powered-By: PHP/7.4.16
Example 2: X-Powered-By: ASP.NET
Example 3: X-Powered-By: Express
Keep-Alive
This header is used to enable persistent connections between the client and the server, allowing multiple requests and responses to be sent over a single TCP connection. By keeping the connection open, the overhead of establishing a new connection for each request can be avoided, improving performance. The header value can specify the maximum number of requests that can be sent over a single connection or the maximum amount of time that a connection can be idle before it is closed.
Example 1: Keep-Alive: timeout=5, max=100
Example 2: Keep-Alive: timeout=10, max=50
Example 3: Keep-Alive: timeout=15, max=200
Conclusion
In conclusion, HTTP response headers provide valuable information about the data being sent in the response from the server to the client. By understanding these headers and
HTTP Security Response Headers Cheat Sheet¶
HTTP Headers are a great booster for web security with easy implementation. Proper HTTP response headers can help prevent security vulnerabilities like Cross-Site Scripting, Clickjacking, Information disclosure and more.
In this cheat sheet, we will review all security-related HTTP headers, recommended configurations, and reference other sources for complicated headers.
Security Headers¶
X-Frame-Options¶
The X-Frame-Options HTTP response header can be used to indicate whether or not a browser should be allowed to render a page in a <frame> , <iframe> , <embed> or <object> . Sites can use this to avoid clickjacking attacks, by ensuring that their content is not embedded into other sites.
Content Security Policy (CSP) frame-ancestors directive obsoletes X-Frame-Options for supporting browsers (source).
X-Frame-Options header is only useful when the HTTP response where it is included has something to interact with (e.g. links, buttons). If the HTTP response is a redirect or an API returning JSON data, X-Frame-Options does not provide any security.
Recommendation¶
Use Content Security Policy (CSP) frame-ancestors directive if possible.
Do not allow displaying of the page in a frame.
X-XSS-Protection¶
The HTTP X-XSS-Protection response header is a feature of Internet Explorer, Chrome, and Safari that stops pages from loading when they detect reflected cross-site scripting (XSS) attacks.
WARNING: Even though this header can protect users of older web browsers that don’t yet support CSP, in some cases, this header can create XSS vulnerabilities in otherwise safe websites source.
Recommendation¶
Use a Content Security Policy (CSP) that disables the use of inline JavaScript.
Do not set this header or explicitly turn it off.
X-Content-Type-Options¶
The X-Content-Type-Options response HTTP header is used by the server to indicate to the browsers that the MIME types advertised in the Content-Type headers should be followed and not guessed.
This header is used to block browsers’ MIME type sniffing, which can transform non-executable MIME types into executable MIME types (MIME Confusion Attacks).
Recommendation¶
Set the Content-Type header correctly throughout the site.
Referrer-Policy¶
The Referrer-Policy HTTP header controls how much referrer information (sent via the Referer header) should be included with requests.
Recommendation¶
Referrer policy has been supported by browsers since 2014. Today, the default behavior in modern browsers is to no longer send all referrer information (origin, path, and query string) to the same site but to only send the origin to other sites. However, since not all users may be using the latest browsers we suggest forcing this behavior by sending this header on all responses.
- NOTE: For more information on configuring this header please see Mozilla Referrer-Policy.
Content-Type¶
The Content-Type representation header is used to indicate the original media type of the resource (before any content encoding is applied for sending). If not set correctly, the resource (e.g. an image) may be interpreted as HTML, making XSS vulnerabilities possible.
Although it is recommended to always set the Content-Type header correctly, it would constitute a vulnerability only if the content is intended to be rendered by the client and the resource is untrusted (provided or modified by a user).
Recommendation¶
- NOTE: the charset attribute is necessary to prevent XSS in HTML pages
- NOTE: the text/html can be any of the possible MIME types
Set-Cookie¶
The Set-Cookie HTTP response header is used to send a cookie from the server to the user agent, so the user agent can send it back to the server later. To send multiple cookies, multiple Set-Cookie headers should be sent in the same response.
This is not a security header per se, but its security attributes are crucial.
Recommendation¶
- Please read Session Management Cheat Sheet for a detailed explanation on cookie configuration options.
Strict-Transport-Security (HSTS)¶
The HTTP Strict-Transport-Security response header (often abbreviated as HSTS) lets a website tell browsers that it should only be accessed using HTTPS, instead of using HTTP.
Recommendation¶
Strict-Transport-Security: max-age=63072000; includeSubDomains; preload
- NOTE: Read carefully how this header works before using it. If the HSTS header is misconfigured or if there is a problem with the SSL/TLS certificate being used, legitimate users might be unable to access the website. For example, if the HSTS header is set to a very long duration and the SSL/TLS certificate expires or is revoked, legitimate users might be unable to access the website until the HSTS header duration has expired.
Expect-CT ❌¶
The Expect-CT header lets sites opt-in to reporting of Certificate Transparency (CT) requirements. Given that mainstream clients now require CT qualification, the only remaining value is reporting such occurrences to the nominated report-uri value in the header. The header is now less about enforcement and more about detection/reporting.
Recommendation¶
Do not use it. Mozilla recommends avoiding it, and removing it from existing code if possible.
Content-Security-Policy (CSP)¶
Content Security Policy (CSP) is a security feature that is used to specify the origin of content that is allowed to be loaded on a website or in a web applications. It is an added layer of security that helps to detect and mitigate certain types of attacks, including Cross-Site Scripting (XSS) and data injection attacks. These attacks are used for everything from data theft to site defacement to distribution of malware.
- NOTE: This header is relevant to be applied in pages which can load and interpret scripts and code, but might be meaningless in the response of a REST API that returns content that is not going to be rendered.
Recommendation¶
Content Security Policy is complex to configure and maintain. For an explanation on customization options, please read Content Security Policy Cheat Sheet
Access-Control-Allow-Origin¶
If you don’t use this header, your site is protected by default by the Same Origin Policy (SOP). What this header does is relax this control in specified circumstances.
The Access-Control-Allow-Origin is a CORS (cross-origin resource sharing) header. This header indicates whether the response it is related to can be shared with requesting code from the given origin. In other words, if siteA requests a resource from siteB, siteB should indicate in its Access-Control-Allow-Origin header that siteA is allowed to fetch that resource, if not, the access is blocked due to Same Origin Policy (SOP).
Recommendation¶
If you use it, set specific origins instead of * . Checkout Access-Control-Allow-Origin for details.
- NOTE: The use ‘‘ might be necessary depending on your needs. For example, for a public API that should be accessible from any origin, it might be necessary to allow ‘‘.
Cross-Origin-Opener-Policy (COOP)¶
The HTTP Cross-Origin-Opener-Policy (COOP) response header allows you to ensure a top-level document does not share a browsing context group with cross-origin documents.
This header works together with Cross-Origin-Embedder-Policy (COEP) and Cross-Origin-Resource-Policy (CORP) explained below.
This mechanism protects against attacks like Spectre which can cross the security boundary established by Same Origin Policy (SOP) for resources in the same browsing context group.
As this headers are very related to browsers, it may not make sense to be applied to REST APIs or clients that are not browsers.
Recommendation¶
Isolates the browsing context exclusively to same-origin documents.
HTTP Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy (COEP)¶
The HTTP Cross-Origin-Embedder-Policy (COEP) response header prevents a document from loading any cross-origin resources that don’t explicitly grant the document permission (using CORP or CORS).
- NOTE: Enabling this will block cross-origin resources not configured correctly from loading.
Recommendation¶
A document can only load resources from the same origin, or resources explicitly marked as loadable from another origin.
- NOTE: you can bypass it for specific resources by adding the crossorigin attribute:
- <img src=»https://thirdparty.com/img.png» crossorigin>
Cross-Origin-Resource-Policy (CORP)¶
The Cross-Origin-Resource-Policy (CORP) header allows you to control the set of origins that are empowered to include a resource. It is a robust defense against attacks like Spectre, as it allows browsers to block a given response before it enters an attacker’s process.
Recommendation¶
Limit current resource loading to the site and sub-domains only.
Permissions-Policy (formerly Feature-Policy)¶
Permissions-Policy allows you to control which origins can use which browser features, both in the top-level page and in embedded frames. For every feature controlled by Feature Policy, the feature is only enabled in the current document or frame if its origin matches the allowed list of origins. This means that you can configure your site to never allow the camera or microphone to be activated. This prevents that an injection, for example an XSS, enables the camera, the microphone, or other browser feature.
Recommendation¶
Set it and disable all the features that your site does not need or allow them only to the authorized domains:
Permissions-Policy: geolocation=(), camera=(), microphone=()
- NOTE: This example is disabling geolocation, camera, and microphone for all domains.
FLoC (Federated Learning of Cohorts)¶
FLoC is a method proposed by Google in 2021 to deliver interest-based advertisements to groups of users («cohorts»). The Electronic Frontier Foundation, Mozilla, and others believe FLoC does not do enough to protect users’ privacy.
Recommendation¶
A site can declare that it does not want to be included in the user’s list of sites for cohort calculation by sending this HTTP header.
Server¶
The Server header describes the software used by the origin server that handled the request — that is, the server that generated the response.
This is not a security header, but how it is used is relevant for security.
Recommendation¶
Remove this header or set non-informative values.
- NOTE: Remember that attackers have other means of fingerprinting the server technology.
X-Powered-By¶
The X-Powered-By header describes the technologies used by the webserver. This information exposes the server to attackers. Using the information in this header, attackers can find vulnerabilities easier.
Recommendation¶
Remove all X-Powered-By headers.
- NOTE: Remember that attackers have other means of fingerprinting your tech stack.
X-AspNet-Version¶
Provides information about the .NET version.
Recommendation¶
Disable sending this header. Add the following line in your web.config in the <system.web> section to remove it.
- NOTE: Remember that attackers have other means of fingerprinting your tech stack.
X-AspNetMvc-Version¶
Provides information about the .NET version.
Recommendation¶
Disable sending this header. To remove the X-AspNetMvc-Version header, add the below line in Global.asax file.
- NOTE: Remember that attackers have other means of fingerprinting your tech stack.
X-DNS-Prefetch-Control¶
The X-DNS-Prefetch-Control HTTP response header 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.
Recommendation¶
The default behavior of browsers is to perform DNS caching which is good for most websites. If you do not control links on your website, you might want to set off as a value to disable DNS prefetch to avoid leaking information to those domains.
- NOTE: Do not rely in this functionality for anything production sensitive: it is not standard or fully supported and implementation may vary among browsers.
Public-Key-Pins (HPKP)¶
The HTTP Public-Key-Pins response header is used to associate a specific cryptographic public key with a certain web server to decrease the risk of MITM attacks with forged certificates.
Recommendation¶
This header is deprecated and should not be used anymore.
Adding HTTP Headers in Different Technologies¶
The sample code below sets the X-Frame-Options header in PHP.
Apache¶
Below is an .htaccess sample configuration which sets the X-Frame-Options header in Apache.
Add configurations below to your Web.config in IIS to send the X-Frame-Options header.
HAProxy¶
Add the line below to your front-end, listen, or backend configurations to send the X-Frame-Options header.
Nginx¶
Below is a sample configuration, it sets the X-Frame-Options header in Nginx.
Express¶
You can use helmet to setup HTTP headers in Express. The code below is sample for adding the X-Frame-Options header.
Testing Proper Implementation of Security Headers¶
Mozilla Observatory¶
The Mozilla Observatory is an online tool which helps you to check your website’s header status.
SmartScanner¶
SmartScanner has a dedicated test profile for testing security of HTTP headers. Online tools usually test the homepage of the given address. But SmartScanner scans the whole website. So, you can make sure all of your web pages have the right HTTP Headers in place.
HTTP headers
HTTP headers let the client and the server pass additional information with an HTTP request or response. An HTTP header consists of its case-insensitive name followed by a colon ( : ), then by its value. Whitespace before the value is ignored.
Custom proprietary headers have historically been used with an X- prefix, but this convention was deprecated in June 2012 because of the inconveniences it caused when nonstandard fields became standard in RFC 6648; others are listed in an IANA registry, whose original content was defined in RFC 4229. IANA also maintains a registry of proposed new HTTP headers.
Headers can be grouped according to their contexts:
-
contain more information about the resource to be fetched, or about the client requesting the resource. hold additional information about the response, like its location or about the server providing it. contain information about the body of the resource, like its MIME type, or encoding/compression applied. contain representation-independent information about payload data, including content length and the encoding used for transport.
Headers can also be grouped according to how proxies handle them:
These headers must be transmitted to the final recipient of the message: the server for a request, or the client for a response. Intermediate proxies must retransmit these headers unmodified and caches must store them.
These headers are meaningful only for a single transport-level connection, and must not be retransmitted by proxies or cached. Note that only hop-by-hop headers may be set using the Connection header.
Authentication
Defines the authentication method that should be used to access a resource.
Contains the credentials to authenticate a user-agent with a server.
Defines the authentication method that should be used to access a resource behind a proxy server.
Contains the credentials to authenticate a user agent with a proxy server.
Caching
The time, in seconds, that the object has been in a proxy cache.
Directives for caching mechanisms in both requests and responses.
Clears browsing data (e.g. cookies, storage, cache) associated with the requesting website.
The date/time after which the response is considered stale.
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 Cache-Control header is not yet present.
General warning information about possible problems.
Client hints
HTTP Client hints are a set of request headers that provide useful information about the client such as device type and network conditions, and allow servers to optimize what is served for those conditions.
Servers proactively requests the client hint headers they are interested in from the client using Accept-CH . The client may then choose to include the requested headers in subsequent requests.
Servers can advertise support for Client Hints using the Accept-CH header field or an equivalent HTML <meta> element with http-equiv attribute.
Servers can ask the client to remember the set of Client Hints that the server supports for a specified period of time, to enable delivery of Client Hints on subsequent requests to the server’s origin.
Servers use Critical-CH along with Accept-CH to specify that accepted client hints are also critical client hints.
The different categories of client hints are listed below.
User agent client hints
The UA client hints are request headers that provide information about the user agent, the platform/architecture it is running on, and user preferences set on the user agent or platform:
User agent’s branding and version.
User agent’s underlying platform architecture.
User agent’s underlying CPU architecture bitness (for example «64» bit).
User agent’s full semantic version string.
Full version for each brand in the user agent’s brand list.
User agent is running on a mobile device or, more generally, prefers a «mobile» user experience.
User agent’s device model.
User agent’s underlying operation system/platform.
User agent’s underlying operation system version.
User’s preference of dark or light color scheme.
User’s preference to see fewer animations and content layout shifts.
Device client hints
Response header used to confirm the image device to pixel ratio in requests where the DPR client hint was used to select an image resource.
Approximate amount of available client RAM memory. This is part of the Device Memory API.
Client device pixel ratio (DPR), which is the number of physical device pixels corresponding to every CSS pixel.
A number that indicates the layout viewport width in CSS pixels. The provided pixel value is a number rounded to the smallest following integer (i.e. ceiling value).
A number that indicates the desired resource width in physical pixels (i.e. intrinsic size of an image).
Network client hints
Network client hints allow a server to choose what information is sent based on the user choice and network bandwidth and latency.
Approximate bandwidth of the client’s connection to the server, in Mbps. This is part of the Network Information API.
The effective connection type («network profile») that best matches the connection’s latency and bandwidth. This is part of the Network Information API.
Application layer round trip time (RTT) in milliseconds, which includes the server processing time. This is part of the Network Information API.
A string on that indicates the user agent’s preference for reduced data usage.
Conditionals
The last modification date of the resource, used to compare several versions of the same resource. It is less accurate than ETag , but easier to calculate in some environments. Conditional requests using If-Modified-Since and If-Unmodified-Since use this value to change the behavior of the request.
A unique string identifying the version of the resource. Conditional requests using If-Match and If-None-Match use this value to change the behavior of the request.
Makes the request conditional, and applies the method only if the stored resource matches one of the given ETags.
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 uploading a new resource when one already exists.
Makes the request conditional, and expects the resource 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.
Makes the request conditional, and expects the resource to be transmitted only if it has not been modified after the given date. This ensures 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.
Determines how to match request headers to decide whether a cached response can be used rather than requesting a fresh one from the origin server.
Connection management
Controls whether the network connection stays open after the current transaction finishes.
Controls how long a persistent connection should stay open.
Content negotiation
Informs the server about the types of data that can be sent back.
The encoding algorithm, usually a compression algorithm, that can be used on the resource sent back.
Informs the server about the human 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 from a dropdown).
Controls
Indicates expectations that need to be fulfilled by the server to properly handle the request.
When using TRACE , indicates the maximum number of hops the request can do before being reflected to the sender.
Cookies
Contains stored HTTP cookies previously sent by the server with the Set-Cookie header.
Send cookies from the server to the user-agent.
Learn more about CORS here.
Indicates whether the response can be shared.
Indicates whether the response to the request can be exposed when the credentials flag is true.
Used in response to a preflight request to indicate which HTTP headers can be used when making the actual request.
Specifies the methods allowed when accessing the resource in response to a preflight request.
Indicates which headers can be exposed as part of the response by listing their names.
Indicates how long the results of a preflight request can be cached.
Used when issuing a preflight request to let the server know which HTTP headers will be used when the actual request is made.
Used when issuing a preflight request to let the server know which HTTP method will be used when the actual request is made.
Indicates where a fetch originates from.
Specifies origins that are allowed to see values of attributes retrieved via features of the Resource Timing API, which would otherwise be reported as zero due to cross-origin restrictions.
Downloads
Indicates if the resource transmitted should be displayed inline (default behavior without the header), or if it should be handled like a download and the browser should present a «Save As» dialog.
Message body information
The size of the resource, in decimal number of bytes.
Indicates the media type of the resource.
Used to specify the compression algorithm.
Describes the human language(s) intended for the audience, so that it allows a user to differentiate according to the users’ own preferred language.
Indicates an alternate location for the returned data.
Proxies
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.
Identifies the originating IP addresses of a client connecting to a web server through an HTTP proxy or a load balancer.
Identifies the original host requested that a client used to connect to your proxy or load balancer.
Identifies the protocol (HTTP or HTTPS) that a client used to connect to your proxy or load balancer.
Added by proxies, both forward and reverse proxies, and can appear in the request headers and the response headers.
Privacy
Indicates whether the user consents to a website or service selling or sharing their personal information with third parties.
Redirects
Indicates the URL to redirect a page to.
Directs the browser to reload the page or redirect to another. Takes the same value as the meta element with http-equiv=»refresh» .
Request context
Contains an Internet email address for a human user who controls the requesting user agent.
Specifies the domain name of the server (for virtual hosting), and (optionally) the TCP port number on which the server is listening.
The address of the previous web page from which a link to the currently requested page was followed.
Governs which referrer information sent in the Referer header should be included with requests made.
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 Firefox user agent string reference.
Response context
Lists the set of HTTP request methods supported by a resource.
Contains information about the software used by the origin server to handle the request.
Range requests
Indicates if the server supports range requests, and if so in which unit the range can be expressed.
Indicates the part of a document that the server should return.
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.
Indicates where in a full body message a partial message belongs.
Security
Allows a server to declare an embedder policy for a given document.
Prevents other domains from opening/controlling a window.
Prevents other domains from reading the response of the resources to which this header is applied.
Controls resources the user agent is allowed to load for a given page.
Allows web developers to experiment with policies by monitoring, but not enforcing, their effects. These violation reports consist of JSON documents sent via an HTTP POST request to the specified URI.
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.
Provides a mechanism to allow web applications to isolate their origins.
Provides a mechanism to allow and deny the use of browser features in a website’s own frame, and in <iframe> s that it embeds.
Force communication using HTTPS instead of HTTP.
Sends a signal to the server expressing the client’s preference for an encrypted and authenticated response, and that it can successfully handle the upgrade-insecure-requests directive.
Disables MIME sniffing and forces browser to use the type given in Content-Type .
Indicates whether a browser should be allowed to render a page in a <frame> , <iframe> , <embed> or <object> .
Specifies if a cross-domain policy file ( crossdomain.xml ) is allowed. The file may define a policy to grant clients, such as Adobe’s Flash Player (now obsolete), Adobe Acrobat, Microsoft Silverlight (now obsolete), or Apache Flex, permission to handle data across domains that would otherwise be restricted due to the Same-Origin Policy. See the Cross-domain Policy File Specification for more information.
May be set by hosting environments or other frameworks and contains information about them while not providing any usefulness to the application or its visitors. Unset this header to avoid exposing potential vulnerabilities.
Enables cross-site scripting filtering.
Fetch metadata request headers
Fetch metadata request headers provide information about the context from which the request originated. A server can use them to make decisions about whether a request should be allowed, based on where the request came from and how the resource will be used.
Indicates the relationship between a request initiator’s origin and its target’s origin. It is a Structured Header whose value is a token with possible values cross-site , same-origin , same-site , and none .
Indicates the request’s mode to a server. It is a Structured Header whose value is a token with possible values cors , navigate , no-cors , same-origin , and websocket .
Indicates whether or not a navigation request was triggered by user activation. It is a Structured Header whose value is a boolean so possible values are ?0 for false and ?1 for true.
Indicates the request’s destination. It is a Structured Header whose value is a token with possible values audio , audioworklet , document , embed , empty , font , image , manifest , object , paintworklet , report , script , serviceworker , sharedworker , style , track , video , worker , and xslt .
The following request headers are not strictly «fetch metadata request headers», but similarly provide information about the context of how a resource will be used. A server might use them to modify its caching behavior, or the information that is returned:
Indicates the purpose of the request, when the purpose is something other than immediate use by the user-agent. The header currently has one possible value, prefetch , which indicates that the resource is being fetched preemptively for a possible future navigation.
A request header sent in preemptive request to fetch() a resource during service worker boot. The value, which is set with NavigationPreloadManager.setHeaderValue() , can be used to inform a server that a different resource should be returned than in a normal fetch() operation.
Server-sent events
Defines a mechanism that enables developers to declare a network error reporting policy.
Used to specify a server endpoint for the browser to send warning and error reports to.
Transfer coding
Specifies the form of encoding used to safely transfer the resource to the user.
Specifies the transfer encodings the user agent is willing to accept.
Allows the sender to include additional fields at the end of chunked message.
WebSockets
Other
A client can express the desired push policy for a request by sending an Accept-Push-Policy header field in the request.
A client can send the Accept-Signature header field to indicate intention to take advantage of any available signatures and to indicate what kinds of signatures it supports.
Used to list alternate ways to reach this service.
Used to identify the alternative service in use.
Contains the date and time at which the message was originated.
Indicates that the request has been conveyed in TLS early data.
Tells the browser that the page being loaded is going to want to perform a large allocation.
The Link entity-header field provides a means for serializing one or more links in HTTP headers. It is semantically equivalent to the HTML <link> element.
A Push-Policy defines the server behavior regarding push when processing a request.
Indicates how long the user agent should wait before making a follow-up request.
The Signature header field conveys a list of signatures for an exchange, each one accompanied by information about how to determine the authority of and refresh that signature.
The Signed-Headers header field identifies an ordered list of response header fields to include in a signature.
Communicates one or more metrics and descriptions for the given request-response cycle.
Links generated code to a source map.
The relevant RFC document for the Upgrade header field is RFC 9110, section 7.8. 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 WebSocket, 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 please see section 7.6.1 of the aforementioned RFC.
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.
The X-Robots-Tag HTTP header is used to indicate how a web page is to be indexed within public search engine results. The header is effectively equivalent to <meta name=»robots» content=»…»> .
Что означает "x-powered by"?
Мне просто любопытно узнать, что означает «x-powered by», когда мы пытаемся найти информацию о веб-сервере о каком-либо веб-сайте.
На самом деле я пытаюсь выяснить, какие технологии используют разные сайты. Но путаница возникает, когда «Информация о веб-сервере» для одного конкретного сайта показывает x-powered-by: ZendServer 8.5.0,ASP.NET который показывает ZendServer это для php а также ASP.NET что противоположно (технологии) php. Плохой вопрос, который приходит мне в голову после просмотра этой информации x-powered-by такое «Они используют оба одновременно?»
3 ответа
«X-Powered-By» — это обычный нестандартный заголовок ответа HTTP (большинство заголовков с префиксом «X-» являются нестандартными). Он часто включается по умолчанию в ответы, построенные с помощью определенной технологии сценариев.
Важно отметить, что это может быть отключено и / или изменено сервером. Некоторые серверы решили не включать его или даже предоставлять вводящую в заблуждение информацию, чтобы отбросить хакеров, которые могут быть нацелены на конкретную технологию / версию.
Если я хочу отправить этот заголовок ответа в сценарии PHP, это так же просто, как включить следующий код:
заголовок (‘x-powered-by: ZendServer 8.5.0,ASP.NET’);
Этому нельзя обязательно доверять. Рассматриваемый сервер вполне может использовать некоторую комбинацию технологий, о которых вы упомянули, или, возможно, ни одну из них. Это может быть полезным началом, но невозможно точно определить, какое программное обеспечение для сценариев используется на сервере, просто из ответа HTTP.