diff options
Diffstat (limited to 'files/ru/web/http')
-rw-r--r-- | files/ru/web/http/authentication/index.html (renamed from files/ru/web/http/авторизация/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/basics_of_http/identifying_resources_on_the_web/index.html (renamed from files/ru/web/http/basics_of_http/identifying_resources_on_the_web_ru/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/caching/index.html (renamed from files/ru/web/http/кэширование/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/cookies/index.html (renamed from files/ru/web/http/куки/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/headers/accept-charset/index.html (renamed from files/ru/web/http/заголовки/accept-charset/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/headers/accept-language/index.html (renamed from files/ru/web/http/заголовки/accept-language/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/headers/accept-patch/index.html (renamed from files/ru/web/http/заголовки/accept-patch/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/headers/accept-ranges/index.html (renamed from files/ru/web/http/заголовки/accept-ranges/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/headers/accept/index.html (renamed from files/ru/web/http/заголовки/accept/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/headers/access-control-allow-headers/index.html (renamed from files/ru/web/http/заголовки/access-control-allow-headers/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/headers/access-control-allow-methods/index.html (renamed from files/ru/web/http/заголовки/access-control-allow-methods/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/headers/access-control-allow-origin/index.html (renamed from files/ru/web/http/заголовки/access-control-allow-origin/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/headers/access-control-max-age/index.html (renamed from files/ru/web/http/заголовки/access-control-max-age/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/headers/authorization/index.html (renamed from files/ru/web/http/заголовки/authorization/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/headers/cache-control/index.html (renamed from files/ru/web/http/заголовки/cache-control/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/headers/connection/index.html (renamed from files/ru/web/http/заголовки/connection/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/headers/content-disposition/index.html (renamed from files/ru/web/http/заголовки/content-disposition/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/headers/content-encoding/index.html (renamed from files/ru/web/http/заголовки/content-encoding/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/headers/content-language/index.html (renamed from files/ru/web/http/заголовки/content-language/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/headers/content-length/index.html (renamed from files/ru/web/http/заголовки/content-length/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/headers/content-type/index.html (renamed from files/ru/web/http/заголовки/content-type/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/headers/date/index.html (renamed from files/ru/web/http/заголовки/date/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/headers/dnt/index.html (renamed from files/ru/web/http/заголовки/dnt/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/headers/etag/index.html (renamed from files/ru/web/http/заголовки/etag/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/headers/expect/index.html (renamed from files/ru/web/http/заголовки/expect/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/headers/expires/index.html (renamed from files/ru/web/http/заголовки/expires/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/headers/host/index.html (renamed from files/ru/web/http/заголовки/host/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/headers/if-match/index.html (renamed from files/ru/web/http/заголовки/if-match/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/headers/if-modified-since/index.html (renamed from files/ru/web/http/заголовки/if-modified-since/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/headers/if-unmodified-since/index.html (renamed from files/ru/web/http/заголовки/if-unmodified-since/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/headers/index.html (renamed from files/ru/web/http/заголовки/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/headers/last-modified/index.html (renamed from files/ru/web/http/заголовки/last-modified/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/headers/origin/index.html (renamed from files/ru/web/http/заголовки/origin/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/headers/pragma/index.html (renamed from files/ru/web/http/заголовки/pragma/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/headers/range/index.html (renamed from files/ru/web/http/заголовки/range/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/headers/referer/index.html (renamed from files/ru/web/http/заголовки/referer/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/headers/retry-after/index.html (renamed from files/ru/web/http/заголовки/retry-after/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/headers/set-cookie/index.html (renamed from files/ru/web/http/заголовки/set-cookie/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/headers/strict-transport-security/index.html (renamed from files/ru/web/http/заголовки/strict-transport-security/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/headers/vary/index.html (renamed from files/ru/web/http/заголовки/vary/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/headers/x-content-type-options/index.html (renamed from files/ru/web/http/заголовки/x-content-type-options/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/headers/x-forwarded-for/index.html (renamed from files/ru/web/http/заголовки/x-forwarded-for/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/headers/x-xss-protection/index.html (renamed from files/ru/web/http/заголовки/x-xss-protection/index.html) | 3 | ||||
-rw-r--r-- | files/ru/web/http/server-side_access_control/index.html | 213 |
44 files changed, 86 insertions, 256 deletions
diff --git a/files/ru/web/http/авторизация/index.html b/files/ru/web/http/authentication/index.html index 99228e7633..8896a66039 100644 --- a/files/ru/web/http/авторизация/index.html +++ b/files/ru/web/http/authentication/index.html @@ -1,11 +1,12 @@ --- title: HTTP авторизация -slug: Web/HTTP/Авторизация +slug: Web/HTTP/Authentication tags: - Авторизация - Разграничение доступа - Руководство translation_of: Web/HTTP/Authentication +original_slug: Web/HTTP/Авторизация --- <div>{{HTTPSidebar}}</div> diff --git a/files/ru/web/http/basics_of_http/identifying_resources_on_the_web_ru/index.html b/files/ru/web/http/basics_of_http/identifying_resources_on_the_web/index.html index 2b52d642b2..5109191113 100644 --- a/files/ru/web/http/basics_of_http/identifying_resources_on_the_web_ru/index.html +++ b/files/ru/web/http/basics_of_http/identifying_resources_on_the_web/index.html @@ -1,6 +1,6 @@ --- title: Идентификация ресурсов в Вебе -slug: Web/HTTP/Basics_of_HTTP/Identifying_resources_on_the_Web_RU +slug: Web/HTTP/Basics_of_HTTP/Identifying_resources_on_the_Web tags: - HTTP - URI @@ -16,6 +16,7 @@ tags: - домен - запрос translation_of: Web/HTTP/Basics_of_HTTP/Identifying_resources_on_the_Web +original_slug: Web/HTTP/Basics_of_HTTP/Identifying_resources_on_the_Web_RU --- <div>{{HTTPSidebar}}</div> diff --git a/files/ru/web/http/кэширование/index.html b/files/ru/web/http/caching/index.html index 8e472eb126..ff4905250b 100644 --- a/files/ru/web/http/кэширование/index.html +++ b/files/ru/web/http/caching/index.html @@ -1,12 +1,13 @@ --- title: HTTP-кеширование -slug: Web/HTTP/Кэширование +slug: Web/HTTP/Caching tags: - HTTP - Кеширование - Кэширование - Руководство translation_of: Web/HTTP/Caching +original_slug: Web/HTTP/Кэширование --- <div>{{HTTPSidebar}}</div> diff --git a/files/ru/web/http/куки/index.html b/files/ru/web/http/cookies/index.html index 154f05cdb0..15aedf93b7 100644 --- a/files/ru/web/http/куки/index.html +++ b/files/ru/web/http/cookies/index.html @@ -1,9 +1,10 @@ --- title: Куки HTTP -slug: Web/HTTP/Куки +slug: Web/HTTP/Cookies tags: - Куки translation_of: Web/HTTP/Cookies +original_slug: Web/HTTP/Куки --- <p>{{HTTPSidebar}}</p> diff --git a/files/ru/web/http/заголовки/accept-charset/index.html b/files/ru/web/http/headers/accept-charset/index.html index 97fb4f65e4..5201aa7df9 100644 --- a/files/ru/web/http/заголовки/accept-charset/index.html +++ b/files/ru/web/http/headers/accept-charset/index.html @@ -1,7 +1,8 @@ --- title: Accept-Charset -slug: Web/HTTP/Заголовки/Accept-Charset +slug: Web/HTTP/Headers/Accept-Charset translation_of: Web/HTTP/Headers/Accept-Charset +original_slug: Web/HTTP/Заголовки/Accept-Charset --- <div>{{HTTPSidebar}}</div> diff --git a/files/ru/web/http/заголовки/accept-language/index.html b/files/ru/web/http/headers/accept-language/index.html index 2e1cf9ae57..493d22e849 100644 --- a/files/ru/web/http/заголовки/accept-language/index.html +++ b/files/ru/web/http/headers/accept-language/index.html @@ -1,7 +1,8 @@ --- title: Accept-Language -slug: Web/HTTP/Заголовки/Accept-Language +slug: Web/HTTP/Headers/Accept-Language translation_of: Web/HTTP/Headers/Accept-Language +original_slug: Web/HTTP/Заголовки/Accept-Language --- <div>{{HTTPSidebar}}</div> diff --git a/files/ru/web/http/заголовки/accept-patch/index.html b/files/ru/web/http/headers/accept-patch/index.html index 2dfa99d0ac..5cacf1026f 100644 --- a/files/ru/web/http/заголовки/accept-patch/index.html +++ b/files/ru/web/http/headers/accept-patch/index.html @@ -1,7 +1,8 @@ --- title: Accept-Patch -slug: Web/HTTP/Заголовки/Accept-Patch +slug: Web/HTTP/Headers/Accept-Patch translation_of: Web/HTTP/Headers/Accept-Patch +original_slug: Web/HTTP/Заголовки/Accept-Patch --- <div>{{HTTPSidebar}}</div> diff --git a/files/ru/web/http/заголовки/accept-ranges/index.html b/files/ru/web/http/headers/accept-ranges/index.html index 6637d01bbf..52b098c390 100644 --- a/files/ru/web/http/заголовки/accept-ranges/index.html +++ b/files/ru/web/http/headers/accept-ranges/index.html @@ -1,11 +1,12 @@ --- title: Accept-Ranges -slug: Web/HTTP/Заголовки/Accept-Ranges +slug: Web/HTTP/Headers/Accept-Ranges tags: - HTTP - HTTP Заголовок - заголовок ответа translation_of: Web/HTTP/Headers/Accept-Ranges +original_slug: Web/HTTP/Заголовки/Accept-Ranges --- <div>{{HTTPSidebar}}</div> diff --git a/files/ru/web/http/заголовки/accept/index.html b/files/ru/web/http/headers/accept/index.html index 69ab96233b..ba2539d420 100644 --- a/files/ru/web/http/заголовки/accept/index.html +++ b/files/ru/web/http/headers/accept/index.html @@ -1,11 +1,12 @@ --- title: Accept -slug: Web/HTTP/Заголовки/Accept +slug: Web/HTTP/Headers/Accept tags: - HTTP - Заголовки HTTP - Заголовки запроса HTTP translation_of: Web/HTTP/Headers/Accept +original_slug: Web/HTTP/Заголовки/Accept --- <div>{{HTTPSidebar}}</div> diff --git a/files/ru/web/http/заголовки/access-control-allow-headers/index.html b/files/ru/web/http/headers/access-control-allow-headers/index.html index d392143198..a17c117bc5 100644 --- a/files/ru/web/http/заголовки/access-control-allow-headers/index.html +++ b/files/ru/web/http/headers/access-control-allow-headers/index.html @@ -1,12 +1,13 @@ --- title: Access-Control-Allow-Headers -slug: Web/HTTP/Заголовки/Access-Control-Allow-Headers +slug: Web/HTTP/Headers/Access-Control-Allow-Headers tags: - CORS - HTTP - Заголовок - Справка translation_of: Web/HTTP/Headers/Access-Control-Allow-Headers +original_slug: Web/HTTP/Заголовки/Access-Control-Allow-Headers --- <div>{{HTTPSidebar}}</div> diff --git a/files/ru/web/http/заголовки/access-control-allow-methods/index.html b/files/ru/web/http/headers/access-control-allow-methods/index.html index d3917204bc..8b48a2b470 100644 --- a/files/ru/web/http/заголовки/access-control-allow-methods/index.html +++ b/files/ru/web/http/headers/access-control-allow-methods/index.html @@ -1,11 +1,12 @@ --- title: Access-Control-Allow-Methods -slug: Web/HTTP/Заголовки/Access-Control-Allow-Methods +slug: Web/HTTP/Headers/Access-Control-Allow-Methods tags: - CORS - HTTP - Заголовки translation_of: Web/HTTP/Headers/Access-Control-Allow-Methods +original_slug: Web/HTTP/Заголовки/Access-Control-Allow-Methods --- <div>{{HTTPSidebar}}</div> diff --git a/files/ru/web/http/заголовки/access-control-allow-origin/index.html b/files/ru/web/http/headers/access-control-allow-origin/index.html index 5dc5aa2b7c..deb4b12a85 100644 --- a/files/ru/web/http/заголовки/access-control-allow-origin/index.html +++ b/files/ru/web/http/headers/access-control-allow-origin/index.html @@ -1,7 +1,8 @@ --- title: Access-Control-Allow-Origin -slug: Web/HTTP/Заголовки/Access-Control-Allow-Origin +slug: Web/HTTP/Headers/Access-Control-Allow-Origin translation_of: Web/HTTP/Headers/Access-Control-Allow-Origin +original_slug: Web/HTTP/Заголовки/Access-Control-Allow-Origin --- <div>{{HTTPSidebar}}</div> diff --git a/files/ru/web/http/заголовки/access-control-max-age/index.html b/files/ru/web/http/headers/access-control-max-age/index.html index 0d5d63b8b0..deef2422ab 100644 --- a/files/ru/web/http/заголовки/access-control-max-age/index.html +++ b/files/ru/web/http/headers/access-control-max-age/index.html @@ -1,7 +1,8 @@ --- title: Access-Control-Max-Age -slug: Web/HTTP/Заголовки/Access-Control-Max-Age +slug: Web/HTTP/Headers/Access-Control-Max-Age translation_of: Web/HTTP/Headers/Access-Control-Max-Age +original_slug: Web/HTTP/Заголовки/Access-Control-Max-Age --- <div><code>Заголовок ответа сервера</code><strong><code> Access-Control-Max-Age</code></strong> сообщает браузеру насколько {{glossary("предзапрос")}} (эта информация содержится в заголовках {{HTTPHeader("Access-Control-Allow-Methods")}} и {{HTTPHeader("Access-Control-Allow-Headers")}}) может быть кэширован и опущен при запросах к серверу.</div> diff --git a/files/ru/web/http/заголовки/authorization/index.html b/files/ru/web/http/headers/authorization/index.html index 02679e19f1..462f6f0c57 100644 --- a/files/ru/web/http/заголовки/authorization/index.html +++ b/files/ru/web/http/headers/authorization/index.html @@ -1,12 +1,13 @@ --- title: Authorization -slug: Web/HTTP/Заголовки/Authorization +slug: Web/HTTP/Headers/Authorization tags: - HTTP - HTTP Заголовок - Заголовок - заголовок запроса translation_of: Web/HTTP/Headers/Authorization +original_slug: Web/HTTP/Заголовки/Authorization --- <div>{{HTTPSidebar}}</div> diff --git a/files/ru/web/http/заголовки/cache-control/index.html b/files/ru/web/http/headers/cache-control/index.html index 4dd0c2de68..b626f4a284 100644 --- a/files/ru/web/http/заголовки/cache-control/index.html +++ b/files/ru/web/http/headers/cache-control/index.html @@ -1,9 +1,10 @@ --- title: Cache-Control -slug: Web/HTTP/Заголовки/Cache-Control +slug: Web/HTTP/Headers/Cache-Control tags: - Кэширование translation_of: Web/HTTP/Headers/Cache-Control +original_slug: Web/HTTP/Заголовки/Cache-Control --- <div>{{HTTPSidebar}}</div> diff --git a/files/ru/web/http/заголовки/connection/index.html b/files/ru/web/http/headers/connection/index.html index 48a5a9dce5..1470326d45 100644 --- a/files/ru/web/http/заголовки/connection/index.html +++ b/files/ru/web/http/headers/connection/index.html @@ -1,12 +1,13 @@ --- title: Connection -slug: Web/HTTP/Заголовки/Connection +slug: Web/HTTP/Headers/Connection tags: - HTTP - Веб - Заголовки - Справка translation_of: Web/HTTP/Headers/Connection +original_slug: Web/HTTP/Заголовки/Connection --- <div>{{HTTPSidebar}}</div> diff --git a/files/ru/web/http/заголовки/content-disposition/index.html b/files/ru/web/http/headers/content-disposition/index.html index 406cc0720c..7004a28735 100644 --- a/files/ru/web/http/заголовки/content-disposition/index.html +++ b/files/ru/web/http/headers/content-disposition/index.html @@ -1,11 +1,12 @@ --- title: Content-Disposition -slug: Web/HTTP/Заголовки/Content-Disposition +slug: Web/HTTP/Headers/Content-Disposition tags: - HTTP - HTTP-заголовок - header translation_of: Web/HTTP/Headers/Content-Disposition +original_slug: Web/HTTP/Заголовки/Content-Disposition --- <div>{{HTTPSidebar}}</div> diff --git a/files/ru/web/http/заголовки/content-encoding/index.html b/files/ru/web/http/headers/content-encoding/index.html index 0f54a68395..47c1db50a5 100644 --- a/files/ru/web/http/заголовки/content-encoding/index.html +++ b/files/ru/web/http/headers/content-encoding/index.html @@ -1,11 +1,12 @@ --- title: Content-Encoding -slug: Web/HTTP/Заголовки/Content-Encoding +slug: Web/HTTP/Headers/Content-Encoding tags: - Content-Encoding - HTTP - Headers translation_of: Web/HTTP/Headers/Content-Encoding +original_slug: Web/HTTP/Заголовки/Content-Encoding --- <div>{{HTTPSidebar}}</div> diff --git a/files/ru/web/http/заголовки/content-language/index.html b/files/ru/web/http/headers/content-language/index.html index dfe3007fc9..82099fc680 100644 --- a/files/ru/web/http/заголовки/content-language/index.html +++ b/files/ru/web/http/headers/content-language/index.html @@ -1,7 +1,8 @@ --- title: Content-Language -slug: Web/HTTP/Заголовки/Content-Language +slug: Web/HTTP/Headers/Content-Language translation_of: Web/HTTP/Headers/Content-Language +original_slug: Web/HTTP/Заголовки/Content-Language --- <div>{{HTTPSidebar}}</div> diff --git a/files/ru/web/http/заголовки/content-length/index.html b/files/ru/web/http/headers/content-length/index.html index 0b2c087b65..8212fa93f4 100644 --- a/files/ru/web/http/заголовки/content-length/index.html +++ b/files/ru/web/http/headers/content-length/index.html @@ -1,6 +1,6 @@ --- title: Content-Length -slug: Web/HTTP/Заголовки/Content-Length +slug: Web/HTTP/Headers/Content-Length tags: - HTTP - Headers @@ -9,6 +9,7 @@ tags: - Заголовок - запрос translation_of: Web/HTTP/Headers/Content-Length +original_slug: Web/HTTP/Заголовки/Content-Length --- <div>{{HTTPSidebar}}</div> diff --git a/files/ru/web/http/заголовки/content-type/index.html b/files/ru/web/http/headers/content-type/index.html index a6900ebab3..7b4197048d 100644 --- a/files/ru/web/http/заголовки/content-type/index.html +++ b/files/ru/web/http/headers/content-type/index.html @@ -1,7 +1,8 @@ --- title: Content-Type -slug: Web/HTTP/Заголовки/Content-Type +slug: Web/HTTP/Headers/Content-Type translation_of: Web/HTTP/Headers/Content-Type +original_slug: Web/HTTP/Заголовки/Content-Type --- <div>{{HTTPSidebar}}</div> diff --git a/files/ru/web/http/заголовки/date/index.html b/files/ru/web/http/headers/date/index.html index 7dded6ea77..db727dfc9b 100644 --- a/files/ru/web/http/заголовки/date/index.html +++ b/files/ru/web/http/headers/date/index.html @@ -1,12 +1,13 @@ --- title: Date -slug: Web/HTTP/Заголовки/Date +slug: Web/HTTP/Headers/Date tags: - HTTP - Reference - Заголовок - Основной заголовок translation_of: Web/HTTP/Headers/Date +original_slug: Web/HTTP/Заголовки/Date --- <div>{{HTTPSidebar}}</div> diff --git a/files/ru/web/http/заголовки/dnt/index.html b/files/ru/web/http/headers/dnt/index.html index a4e7f56864..8b6be230e0 100644 --- a/files/ru/web/http/заголовки/dnt/index.html +++ b/files/ru/web/http/headers/dnt/index.html @@ -1,7 +1,8 @@ --- title: DNT -slug: Web/HTTP/Заголовки/DNT +slug: Web/HTTP/Headers/DNT translation_of: Web/HTTP/Headers/DNT +original_slug: Web/HTTP/Заголовки/DNT --- <p>{{HTTPSidebar}}</p> diff --git a/files/ru/web/http/заголовки/etag/index.html b/files/ru/web/http/headers/etag/index.html index f64994ee97..7a49e75507 100644 --- a/files/ru/web/http/заголовки/etag/index.html +++ b/files/ru/web/http/headers/etag/index.html @@ -1,7 +1,8 @@ --- title: ETag -slug: Web/HTTP/Заголовки/ETag +slug: Web/HTTP/Headers/ETag translation_of: Web/HTTP/Headers/ETag +original_slug: Web/HTTP/Заголовки/ETag --- <div> {{HTTPSidebar}}</div> diff --git a/files/ru/web/http/заголовки/expect/index.html b/files/ru/web/http/headers/expect/index.html index 80a785befa..f6182f09c7 100644 --- a/files/ru/web/http/заголовки/expect/index.html +++ b/files/ru/web/http/headers/expect/index.html @@ -1,7 +1,8 @@ --- title: Expect -slug: Web/HTTP/Заголовки/Expect +slug: Web/HTTP/Headers/Expect translation_of: Web/HTTP/Headers/Expect +original_slug: Web/HTTP/Заголовки/Expect --- <div>{{HTTPSidebar}}</div> diff --git a/files/ru/web/http/заголовки/expires/index.html b/files/ru/web/http/headers/expires/index.html index 2d946f0724..1eea75af01 100644 --- a/files/ru/web/http/заголовки/expires/index.html +++ b/files/ru/web/http/headers/expires/index.html @@ -1,12 +1,13 @@ --- title: Expires -slug: Web/HTTP/Заголовки/Expires +slug: Web/HTTP/Headers/Expires tags: - HTTP - Заголовки - Кеширование - Ответ сервера translation_of: Web/HTTP/Headers/Expires +original_slug: Web/HTTP/Заголовки/Expires --- <div>{{HTTPSidebar}}</div> diff --git a/files/ru/web/http/заголовки/host/index.html b/files/ru/web/http/headers/host/index.html index 4b99e7233c..ebadd5adb5 100644 --- a/files/ru/web/http/заголовки/host/index.html +++ b/files/ru/web/http/headers/host/index.html @@ -1,7 +1,8 @@ --- title: Host -slug: Web/HTTP/Заголовки/Host +slug: Web/HTTP/Headers/Host translation_of: Web/HTTP/Headers/Host +original_slug: Web/HTTP/Заголовки/Host --- <div>{{HTTPSidebar}}</div> diff --git a/files/ru/web/http/заголовки/if-match/index.html b/files/ru/web/http/headers/if-match/index.html index e2c403a90f..f09d5894b5 100644 --- a/files/ru/web/http/заголовки/if-match/index.html +++ b/files/ru/web/http/headers/if-match/index.html @@ -1,7 +1,8 @@ --- title: If-Match -slug: Web/HTTP/Заголовки/If-Match +slug: Web/HTTP/Headers/If-Match translation_of: Web/HTTP/Headers/If-Match +original_slug: Web/HTTP/Заголовки/If-Match --- <div>{{HTTPSidebar}}</div> diff --git a/files/ru/web/http/заголовки/if-modified-since/index.html b/files/ru/web/http/headers/if-modified-since/index.html index 28769b20ae..e08d9e88b9 100644 --- a/files/ru/web/http/заголовки/if-modified-since/index.html +++ b/files/ru/web/http/headers/if-modified-since/index.html @@ -1,12 +1,13 @@ --- title: If-Modified-Since -slug: Web/HTTP/Заголовки/If-Modified-Since +slug: Web/HTTP/Headers/If-Modified-Since tags: - HTTP - Заголовки HTTP - Заголовки запроса - Условные запросы translation_of: Web/HTTP/Headers/If-Modified-Since +original_slug: Web/HTTP/Заголовки/If-Modified-Since --- <div>{{HTTPSidebar}}</div> diff --git a/files/ru/web/http/заголовки/if-unmodified-since/index.html b/files/ru/web/http/headers/if-unmodified-since/index.html index c451f97a4d..93a843facc 100644 --- a/files/ru/web/http/заголовки/if-unmodified-since/index.html +++ b/files/ru/web/http/headers/if-unmodified-since/index.html @@ -1,12 +1,13 @@ --- title: If-Unmodified-Since -slug: Web/HTTP/Заголовки/If-Unmodified-Since +slug: Web/HTTP/Headers/If-Unmodified-Since tags: - HTTP - Заголовок HTTP - Справка - заголовок запроса translation_of: Web/HTTP/Headers/If-Unmodified-Since +original_slug: Web/HTTP/Заголовки/If-Unmodified-Since --- <div> <p>{{HTTPSidebar}}</p> diff --git a/files/ru/web/http/заголовки/index.html b/files/ru/web/http/headers/index.html index 41c24031f8..9cfb918eab 100644 --- a/files/ru/web/http/заголовки/index.html +++ b/files/ru/web/http/headers/index.html @@ -1,10 +1,11 @@ --- title: Заголовки HTTP -slug: Web/HTTP/Заголовки +slug: Web/HTTP/Headers tags: - HTTP - Заголовки translation_of: Web/HTTP/Headers +original_slug: Web/HTTP/Заголовки --- <p>{{ HTTPSidebar }}</p> diff --git a/files/ru/web/http/заголовки/last-modified/index.html b/files/ru/web/http/headers/last-modified/index.html index e5d4b34510..53dae93f65 100644 --- a/files/ru/web/http/заголовки/last-modified/index.html +++ b/files/ru/web/http/headers/last-modified/index.html @@ -1,12 +1,13 @@ --- title: Last-Modified -slug: Web/HTTP/Заголовки/Last-Modified +slug: Web/HTTP/Headers/Last-Modified tags: - HTTP - HTTP Header - Reference - Response Header translation_of: Web/HTTP/Headers/Last-Modified +original_slug: Web/HTTP/Заголовки/Last-Modified --- <div>{{HTTPSidebar}}</div> diff --git a/files/ru/web/http/заголовки/origin/index.html b/files/ru/web/http/headers/origin/index.html index 8b8ad319c7..1f4673dce4 100644 --- a/files/ru/web/http/заголовки/origin/index.html +++ b/files/ru/web/http/headers/origin/index.html @@ -1,7 +1,8 @@ --- title: Origin -slug: Web/HTTP/Заголовки/Origin +slug: Web/HTTP/Headers/Origin translation_of: Web/HTTP/Headers/Origin +original_slug: Web/HTTP/Заголовки/Origin --- <div>{{HTTPSidebar}}</div> diff --git a/files/ru/web/http/заголовки/pragma/index.html b/files/ru/web/http/headers/pragma/index.html index c53891dd44..5ee1b0060f 100644 --- a/files/ru/web/http/заголовки/pragma/index.html +++ b/files/ru/web/http/headers/pragma/index.html @@ -1,10 +1,11 @@ --- title: Pragma -slug: Web/HTTP/Заголовки/Pragma +slug: Web/HTTP/Headers/Pragma tags: - Прагма - кэш translation_of: Web/HTTP/Headers/Pragma +original_slug: Web/HTTP/Заголовки/Pragma --- <div>{{HTTPSidebar}}</div> diff --git a/files/ru/web/http/заголовки/range/index.html b/files/ru/web/http/headers/range/index.html index 62b6d34a86..80396486b9 100644 --- a/files/ru/web/http/заголовки/range/index.html +++ b/files/ru/web/http/headers/range/index.html @@ -1,7 +1,8 @@ --- title: Range -slug: Web/HTTP/Заголовки/Range +slug: Web/HTTP/Headers/Range translation_of: Web/HTTP/Headers/Range +original_slug: Web/HTTP/Заголовки/Range --- <div>{{HTTPSidebar}}</div> diff --git a/files/ru/web/http/заголовки/referer/index.html b/files/ru/web/http/headers/referer/index.html index 3ff8b8d51e..f227769466 100644 --- a/files/ru/web/http/заголовки/referer/index.html +++ b/files/ru/web/http/headers/referer/index.html @@ -1,11 +1,12 @@ --- title: Referer -slug: Web/HTTP/Заголовки/Referer +slug: Web/HTTP/Headers/Referer tags: - HTTP - referer - Заголовок translation_of: Web/HTTP/Headers/Referer +original_slug: Web/HTTP/Заголовки/Referer --- <div>{{HTTPSidebar}}</div> diff --git a/files/ru/web/http/заголовки/retry-after/index.html b/files/ru/web/http/headers/retry-after/index.html index 7e37acd766..75b793195e 100644 --- a/files/ru/web/http/заголовки/retry-after/index.html +++ b/files/ru/web/http/headers/retry-after/index.html @@ -1,12 +1,13 @@ --- title: Retry-After -slug: Web/HTTP/Заголовки/Retry-After +slug: Web/HTTP/Headers/Retry-After tags: - HTTP - Заголовок - заголовок ответа - ответ translation_of: Web/HTTP/Headers/Retry-After +original_slug: Web/HTTP/Заголовки/Retry-After --- <div>{{HTTPSidebar}}</div> diff --git a/files/ru/web/http/заголовки/set-cookie/index.html b/files/ru/web/http/headers/set-cookie/index.html index d7822a1790..96b2086206 100644 --- a/files/ru/web/http/заголовки/set-cookie/index.html +++ b/files/ru/web/http/headers/set-cookie/index.html @@ -1,7 +1,8 @@ --- title: Set-Cookie -slug: Web/HTTP/Заголовки/Set-Cookie +slug: Web/HTTP/Headers/Set-Cookie translation_of: Web/HTTP/Headers/Set-Cookie +original_slug: Web/HTTP/Заголовки/Set-Cookie --- <div> <p>{{HTTPSidebar}}</p> diff --git a/files/ru/web/http/заголовки/strict-transport-security/index.html b/files/ru/web/http/headers/strict-transport-security/index.html index c63308c97e..14e7b9e19d 100644 --- a/files/ru/web/http/заголовки/strict-transport-security/index.html +++ b/files/ru/web/http/headers/strict-transport-security/index.html @@ -1,7 +1,8 @@ --- title: Strict-Transport-Security -slug: Web/HTTP/Заголовки/Strict-Transport-Security +slug: Web/HTTP/Headers/Strict-Transport-Security translation_of: Web/HTTP/Headers/Strict-Transport-Security +original_slug: Web/HTTP/Заголовки/Strict-Transport-Security --- <div>{{HTTPSidebar}}</div> diff --git a/files/ru/web/http/заголовки/vary/index.html b/files/ru/web/http/headers/vary/index.html index a9bf3238e6..25d269b056 100644 --- a/files/ru/web/http/заголовки/vary/index.html +++ b/files/ru/web/http/headers/vary/index.html @@ -1,7 +1,8 @@ --- title: Vary -slug: Web/HTTP/Заголовки/Vary +slug: Web/HTTP/Headers/Vary translation_of: Web/HTTP/Headers/Vary +original_slug: Web/HTTP/Заголовки/Vary --- <div>{{HTTPSidebar}}</div> diff --git a/files/ru/web/http/заголовки/x-content-type-options/index.html b/files/ru/web/http/headers/x-content-type-options/index.html index 7a1762e662..63c668d4ae 100644 --- a/files/ru/web/http/заголовки/x-content-type-options/index.html +++ b/files/ru/web/http/headers/x-content-type-options/index.html @@ -1,12 +1,13 @@ --- title: X-Content-Type-Options -slug: Web/HTTP/Заголовки/X-Content-Type-Options +slug: Web/HTTP/Headers/X-Content-Type-Options tags: - HTTP - HTTP заголовки - Ответы заголовка - Справка translation_of: Web/HTTP/Headers/X-Content-Type-Options +original_slug: Web/HTTP/Заголовки/X-Content-Type-Options --- <div>{{HTTPSidebar}}</div> diff --git a/files/ru/web/http/заголовки/x-forwarded-for/index.html b/files/ru/web/http/headers/x-forwarded-for/index.html index e44d3bd8da..47612909ad 100644 --- a/files/ru/web/http/заголовки/x-forwarded-for/index.html +++ b/files/ru/web/http/headers/x-forwarded-for/index.html @@ -1,11 +1,12 @@ --- title: X-Forwarded-For -slug: Web/HTTP/Заголовки/X-Forwarded-For +slug: Web/HTTP/Headers/X-Forwarded-For tags: - Заголовок - заголовок запроса - оригинальный адрес translation_of: Web/HTTP/Headers/X-Forwarded-For +original_slug: Web/HTTP/Заголовки/X-Forwarded-For --- <div>{{HTTPSidebar}}</div> diff --git a/files/ru/web/http/заголовки/x-xss-protection/index.html b/files/ru/web/http/headers/x-xss-protection/index.html index 847ec38972..29a0a84844 100644 --- a/files/ru/web/http/заголовки/x-xss-protection/index.html +++ b/files/ru/web/http/headers/x-xss-protection/index.html @@ -1,6 +1,6 @@ --- title: X-XSS-Protection -slug: Web/HTTP/Заголовки/X-XSS-Protection +slug: Web/HTTP/Headers/X-XSS-Protection tags: - HTTP - XSS @@ -8,6 +8,7 @@ tags: - Заголовок - Справка translation_of: Web/HTTP/Headers/X-XSS-Protection +original_slug: Web/HTTP/Заголовки/X-XSS-Protection --- <div>{{HTTPSidebar}}</div> diff --git a/files/ru/web/http/server-side_access_control/index.html b/files/ru/web/http/server-side_access_control/index.html deleted file mode 100644 index c3d53cb730..0000000000 --- a/files/ru/web/http/server-side_access_control/index.html +++ /dev/null @@ -1,213 +0,0 @@ ---- -title: Server-Side Access Control (CORS) -slug: Web/HTTP/Server-Side_Access_Control -translation_of: Web/HTTP/CORS -translation_of_original: Web/HTTP/Server-Side_Access_Control ---- -<p>Системы контроля доступа производят идентификацию <a href="http://searchsoftwarequality.techtarget.com/definition/authorization">авторизации</a>, <a href="http://searchsecurity.techtarget.com/definition/authentication">аутентификацию</a>, подтверждение доступа и подотчетность сущностей с помощью учетных данных для входа, включая <a href="http://searchsecurity.techtarget.com/definition/password">пароль</a>, личный идентификационный номер (PINs), <a href="http://searchsecurity.techtarget.com/definition/biometrics">биометрическое</a> сканирование и физический или электронный ключ.</p> - -<p>Контроль доступа --- это техника безопасности, которую можно использовать для регулирования процессом того, кто или что может видеть или использовать ресурсы в вычислительном окружении.</p> - -<p>{{HTTPSidebar}}</p> - -<p>Для меж-сайтовых запросов, произведенных с помощью {{domxref("XMLHttpRequest")}} или <a href="/en-US/docs/Web/API/Fetch_API">Fetch API</a>, браузеры передают специальные <a href="/en-US/docs/Web/HTTP/Headers">HTTP заголовки</a>. Так же ожидаемо увидеть определенные HTTP заголовки, переданные обратно внутри меж-сайтового ответа. Обзор этих заголовков, включая примеры JavaScript кода, создающего запросы и обрабатывающего ответы от сервера, как и описание каждого из заголовков, <a class="internal" href="/en-US/docs/Web/HTTP/Access_control_CORS">может быть найден в статье HTTP Access Control (CORS)</a> и должен быть прочитан вместе с данной. Эта статья покрывает обработку <strong>Запросов контроля доступа</strong> и формулировку <strong>Ответов контроля доступа </strong>в PHP. Целевая аудитория для этой статьи --- разработчики серверов и администраторы. Хотя примеры кода, приведенные тут, на PHP, подобная концепция применяется в ASP.net, Perl, Python, Java, etc.; в общем, эти концепции могут быть применены в любом сервером окружении, который обрабатывает HTTP запросы и динамически формирует HTTP ответы.</p> - -<h2 id="Discussion_of_HTTP_headers">Discussion of HTTP headers</h2> - -<p>The article <a class="internal" href="/en-US/docs/Web/HTTP/Access_control_CORS">covering the HTTP headers used by both clients and servers is here</a>, and should be considered prerequisite reading.</p> - -<h2 id="Working_code_samples">Working code samples</h2> - -<p>The PHP snippets (and the JavaScript invocations to the server) in subsequent sections are taken from <a class="external" href="http://arunranga.com/examples/access-control/">the working code samples posted here.</a> These will work in browsers that implement cross-site {{domxref("XMLHttpRequest")}}.</p> - -<h2 id="Simple_cross-site_requests">Simple cross-site requests</h2> - -<p><a class="internal" href="/en-US/docs/Web/HTTP/Access_control_CORS#Simple_requests">Simple Access Control Requests</a> are initiated when:</p> - -<ul> - <li>An HTTP/1.1 {{HTTPMethod("GET")}} or a {{HTTPMethod("POST")}} is used as request method. In the case of a POST, the {{HTTPHeader("Content-Type")}} of the request body is one of <code>application/x-www-form-urlencoded</code>, <code>multipart/form-data</code>, or <code>text/plain.</code></li> - <li>No custom headers are sent with the HTTP request (such as <code>X-Modified</code>, etc.)</li> -</ul> - -<p>In this case, responses can be sent back based on some considerations.</p> - -<ul> - <li>If the resource in question is meant to be widely accessed (just like any HTTP resource accessed by GET), then sending back the {{HTTPHeader("Access-Control-Allow-Origin")}}<code>: *</code> header will be sufficient, <strong>unless</strong> the resource needs credentials such as <a href="/en-US/docs/Web/HTTP/Cookies">Cookies</a> and HTTP Authentication information.</li> - <li>If the resource should be kept restricted based on requester domain, <strong>OR</strong> if the resource needs to be accessed with credentials (or sets credentials), then filtering by the request's {{HTTPHeader("Origin")}} header may be necessary, or at least echoing back the requester's <code>Origin</code> (e.g. {{HTTPHeader("Access-Control-Allow-Origin")}}<code>: <a class="external" href="http://arunranga.com" rel="freelink">http://arunranga.com</a></code>). Additionally, the {{HTTPHeader("Access-Control-Allow-Credentials")}}<code>: true</code> header will have to be sent. This is discussed in a <a class="internal" href="#Credentialed_Requests">subsequent section</a>.</li> -</ul> - -<p>The section on <a class="internal" href="/en-US/docs/Web/HTTP/Access_control_CORS#Simple_requests">Simple Access Control Requests</a> shows you the header exchanges between client and server. Here is a PHP code segment that handles a Simple Request:</p> - -<pre class="brush: php"><?php - -// We'll be granting access to only the arunranga.com domain -// which we think is safe to access this resource as application/xml - -if($_SERVER['HTTP_ORIGIN'] == "http://arunranga.com") { - header('Access-Control-Allow-Origin: http://arunranga.com'); - header('Content-type: application/xml'); - readfile('arunerDotNetResource.xml'); -} else { - header('Content-Type: text/html'); - echo "<html>"; - echo "<head>"; - echo " <title>Another Resource</title>"; - echo "</head>"; - echo "<body>", - "<p>This resource behaves two-fold:"; - echo "<ul>", - "<li>If accessed from <code>http://arunranga.com</code> it returns an XML document</li>"; - echo "<li>If accessed from any other origin including from simply typing in the URL into the browser's address bar,"; - echo "you get this HTML document</li>", - "</ul>", - "</body>", - "</html>"; -} -?> -</pre> - -<p>The above checks to see if the {{HTTPHeader("Origin")}} header sent by the browser (obtained through $_SERVER['HTTP_ORIGIN']) matches '<a class="external" href="http://arunranga.com" rel="freelink">http://arunranga.com</a>'. If yes, it returns {{HTTPHeader("Access-Control-Allow-Origin")}}<code>: <a class="external" href="http://arunranga.com" rel="freelink">http://arunranga.com</a></code>. This example can be <a class="external" href="http://arunranga.com/examples/access-control/">seen running here</a>.</p> - -<h2 id="Preflighted_requests">Preflighted requests</h2> - -<p><a class="internal" href="/en-US/docs/Web/HTTP/Access_control_CORS#Preflighted_requests">Preflighted Access Control Requests</a> occur when:</p> - -<ul> - <li>A method other than {{HTTPMethod("GET")}} or {{HTTPMethod("POST")}} is used, or if {{HTTPMethod("POST")}} is used with a {{HTTPHeader("Content-Type")}} <strong>other than</strong> one of <code>application/x-www-form-urlencoded</code>, <code>multipart/form-data</code>, or <code>text/plain</code>. For instance, if the <code>Content-Type</code> of the <code>POST</code> body is <code>application/xml</code>, a request is preflighted.</li> - <li>A custom header (such as <code>X-PINGARUNER</code>) is sent with the request.</li> -</ul> - -<p>The section on <a class="internal" href="/en-US/docs/Web/HTTP/Access_control_CORS#Preflighted_requests">Preflighted Access Control Requests</a> shows a header exchange between client and server. A server resource responding to a preflight requests needs to be able to make the following determinations:</p> - -<ul> - <li>Filtration based on {{HTTPHeader("Origin")}}, if any at all.</li> - <li>Response to an {{HTTPMethod("OPTIONS")}} request (which is the preflight request), including sending necessary values with {{HTTPHeader("Access-Control-Allow-Methods")}}, {{HTTPHeader("Access-Control-Allow-Headers")}} (if any additional headers are needed in order for the application to work), and, if credentials are necessary for this resource, {{HTTPHeader("Access-Control-Allow-Credentials")}}.</li> - <li>Response to the actual request, including handling <code>POST</code> data, etc.</li> -</ul> - -<p>Here is an example in PHP of handling a <a class="internal" href="/en-US/docs/Web/HTTP/Access_control_CORS#Preflighted_requests">preflighted request</a>:</p> - -<pre class="brush: php"><?php - -if($_SERVER['REQUEST_METHOD'] == "GET") { - - header('Content-Type: text/plain'); - echo "This HTTP resource is designed to handle POSTed XML input"; - echo "from arunranga.com and not be retrieved with GET"; - -} elseif($_SERVER['REQUEST_METHOD'] == "OPTIONS") { - // Tell the Client we support invocations from arunranga.com and - // that this preflight holds good for only 20 days - - if($_SERVER['HTTP_ORIGIN'] == "http://arunranga.com") { - header('Access-Control-Allow-Origin: http://arunranga.com'); - header('Access-Control-Allow-Methods: POST, GET, OPTIONS'); - header('Access-Control-Allow-Headers: X-PINGARUNER'); - header('Access-Control-Max-Age: 1728000'); - header("Content-Length: 0"); - header("Content-Type: text/plain"); - //exit(0); - } else { - header("HTTP/1.1 403 Access Forbidden"); - header("Content-Type: text/plain"); - echo "You cannot repeat this request"; - } - -} elseif($_SERVER['REQUEST_METHOD'] == "POST") { - // Handle POST by first getting the XML POST blob, - // and then doing something to it, and then sending results to the client - - if($_SERVER['HTTP_ORIGIN'] == "http://arunranga.com") { - $postData = file_get_contents('php://input'); - $document = simplexml_load_string($postData); - - // do something with POST data - - $ping = $_SERVER['HTTP_X_PINGARUNER']; - - header('Access-Control-Allow-Origin: http://arunranga.com'); - header('Content-Type: text/plain'); - echo // some string response after processing - } else { - die("POSTing Only Allowed from arunranga.com"); - } -} else { - die("No Other Methods Allowed"); -} -?> -</pre> - -<p>Note the appropriate headers being sent back in response to the {{HTTPMethod("OPTIONS")}} preflight as well as to the {{HTTPMethod("POST")}} data. One resource thus handles the preflight as well as the actual request. In the response to the <code>OPTIONS</code> request, the server notifies the client that the actual request can indeed be made with the <code>POST</code> method, and header fields such as <code>X-PINGARUNER</code> can be sent with the actual request. This example can be <a class="external" href="http://arunranga.com/examples/access-control/">seen running here</a>.</p> - -<h2 id="Credentialed_requests">Credentialed requests</h2> - -<p><a class="internal" href="/en-US/docs/Web/HTTP/Access_control_CORS#Requests_with_credentials">Credentialed Access Control Requests</a> – that is, requests that are accompanied by <a href="/en-US/docs/Web/HTTP/Cookies">Cookies</a> or HTTP Authentication information (and which expect Cookies to be sent with responses) – can be either <a class="internal" href="/en-US/docs/Web/HTTP/Access_control_CORS#Simple_requests">Simple</a> or <a class="internal" href="/en-US/docs/Web/HTTP/Access_control_CORS#Preflighted_requests">Preflighted</a>, depending on the request methods used.</p> - -<p>In a <a class="internal" href="/en-US/docs/Web/HTTP/Access_control_CORS#Simple_requests">Simple Request</a> scenario, the request will be sent with Cookies (e.g. if the <code><a href="/en-US/docs/Web/API/XMLHttpRequest/withCredentials">withCredentials</a></code> flag is set on {{domxref("XMLHttpRequest")}}). If the server responds with {{HTTPHeader("Access-Control-Allow-Credentials")}}<code>: true</code> attached to the credentialed response, then the response is accepted by the client and exposed to web content. In a <a class="internal" href="/en-US/docs/Web/HTTP/Access_control_CORS#Preflighted_requests">Preflighted Request</a>, the server can respond with <code>Access-Control-Allow-Credentials: true</code> to the <code>OPTIONS</code> request.</p> - -<p>Here is some PHP that handles credentialed requests:</p> - -<pre class="brush: php"><?php - -if($_SERVER['REQUEST_METHOD'] == "GET") { - header('Access-Control-Allow-Origin: http://arunranga.com'); - header('Access-Control-Allow-Credentials: true'); - header('Cache-Control: no-cache'); - header('Pragma: no-cache'); - header('Content-Type: text/plain'); - - // First See if There Is a Cookie - if (!isset($_COOKIE["pageAccess"])) { - setcookie("pageAccess", 1, time()+2592000); - echo 'I do not know you or anyone like you so I am going to'; - echo 'mark you with a Cookie :-)'; - } else { - $accesses = $_COOKIE['pageAccess']; - setcookie('pageAccess', ++$accesses, time()+2592000); - echo 'Hello -- I know you or something a lot like you!'; - echo 'You have been to ', $_SERVER['SERVER_NAME'], '; - echo 'at least ', $accesses-1, ' time(s) before!'; - } -} elseif($_SERVER['REQUEST_METHOD'] == "OPTIONS") { - // Tell the Client this preflight holds good for only 20 days - if($_SERVER['HTTP_ORIGIN'] == "http://arunranga.com") { - header('Access-Control-Allow-Origin: http://arunranga.com'); - header('Access-Control-Allow-Methods: GET, OPTIONS'); - header('Access-Control-Allow-Credentials: true'); - header('Access-Control-Max-Age: 1728000'); - header("Content-Length: 0"); - header("Content-Type: text/plain"); - } else { - header("HTTP/1.1 403 Access Forbidden"); - header("Content-Type: text/plain"); - echo "You cannot repeat this request"; - } -} else { - die("This HTTP Resource can ONLY be accessed with GET or OPTIONS"); -} -?> -</pre> - -<p>Note that in the case of credentialed requests, the <code>Access-Control-Allow-Origin:</code> header <strong>must not</strong> have a wildcard value of "*". It <strong>must</strong> mention a valid origin domain. The example above can be seen <a class="external" href="http://arunranga.com/examples/access-control/">running here</a>.</p> - -<h2 id="Apache_examples">Apache examples</h2> - -<h3 id="Restrict_access_to_certain_URIs">Restrict access to certain URIs</h3> - -<p>One helpful trick is to use an Apache rewrite, environment variable, and headers to apply <code>Access-Control-Allow-*</code> to certain URIs. This is useful, for example, to constrain cross-origin requests to <code>GET /api(.*).json</code> requests without credentials:</p> - -<pre>RewriteRule ^/api(.*)\.json$ /api$1.json [CORS=True] -Header set Access-Control-Allow-Origin "*" env=CORS -Header set Access-Control-Allow-Methods "GET" env=CORS -Header set Access-Control-Allow-Credentials "false" env=CORS -</pre> - -<h2 id="See_also">See also</h2> - -<ul> - <li><a class="external" href="http://arunranga.com/examples/access-control/">Examples of Access Control in Action</a></li> - <li><a href="https://github.com/jackblackevo/cors-jsonp-sample">Client-Side & Server-Side (Java) sample for Cross-Origin Resource Sharing (CORS)</a></li> - <li><a class="internal" href="/en-US/docs/Web/HTTP/Access_control_CORS">HTTP Access Control covering the HTTP headers</a></li> - <li>{{domxref("XMLHttpRequest")}}</li> - <li><a href="/en-US/docs/Web/API/Fetch_API">Fetch API</a></li> -</ul> |