Provisional headers are shown ошибка

The resource could be being blocked by an extension (AdBlock in my case).

The message is there because the request to retrieve that resource was never made, so the headers being shown are not the real thing. As explained in the issue you referenced, the real headers are updated when the server responds, but there is no response if the request was blocked.


The way I found about the extension that was blocking my resource was through the net-internals tool in Chrome:

For Latest Versions of chrome

  • Type chrome://net-export/ in the address bar and hit enter.
  • Start Recording. And save Recording file to local.
  • Open the page that is showing problems.
  • Go back to net-internals
  • You can view Recorded Log file Here https://netlog-viewer.appspot.com/#import
  • click on events (###) and use the textfield to find the event related to your resource (use parts of the URL).
  • Finally, click on the event and see if the info shown tells you something.

For Older Versions of chrome

  • Type chrome://net-internals in the address bar and hit enter.
  • Open the page that is showing problems.
  • Go back to net-internals, click on events (###) and use the textfield to find the event related to your resource (use parts of the URL).
  • Finally, click on the event and see if the info shown tells you something.

Ravi's user avatar

Ravi

1,30210 silver badges18 bronze badges

answered Jan 17, 2014 at 6:14

Willington Vega's user avatar

Willington VegaWillington Vega

4,7123 gold badges21 silver badges19 bronze badges

9

I believe it happens when the actual request is not sent. Usually happens when you are loading a cached resource.

answered Jan 22, 2014 at 0:44

Shazz's user avatar

5

For chrome v72+ what solved it for me was only this:

go to chrome://flags/ and disable this 3 flags

  • Disable site isolation
  • Enable network service
  • Runs network service in-process

enter image description here

or you can do it from command line :

chrome --disable-site-isolation-trials --disable-features=NetworkService,NetworkServiceInProcess

why this happen?

It seems that Google is refactoring their Chromium engine into modular structure, where different services will be separated into stand-alone modules and processes. They call this process servicification. Network service is the first step, Ui service, Identity service and Device service are coming up. Google provides the official information at the Chromium project site.

is it dangerous to change that?

An example is networking: once we have a network service we can choose to run it out of process for better stability/security, or in-process if we’re resource constrained. source

answered Apr 26, 2019 at 10:29

Badr Elmers's user avatar

Badr ElmersBadr Elmers

1,44714 silver badges19 bronze badges

6

I encountered this issue, and I managed to identify a specific cause, which isn’t mentioned above either in answers or the question.

I am running a full js stack, angular front end and node back end on SSL, and the API is on a different domain running on port 8081, so I am doing CORS requests and withCredentials as I am dropping a session cookie from the API

So specifically my scenario was: POST request, withCredentials to port 8081 caused the «CAUTION: provisional headers are shown» message in the inspector and also of course blocked the request all together.

My solution was to set up apache to proxy pass the request from the usual SSL port of 443 to the node SSL port of 8081 (node has to be on a higher port as it cannot be ran as root in prod). So I guess Chrome doesn’t like SSL requests to unconventional SSL ports, but perhaps their error message could be more specific.

answered Feb 11, 2014 at 12:27

Mister P's user avatar

Mister PMister P

1,2431 gold badge11 silver badges9 bronze badges

3

My situation is cross-origin related.
Situation: Browser sends OPTIONS request before sending the real request like GET or POST. Backend developer forgets to deal with the OPTIONS request, letting it go through the service code, making the processing time too long. Longer than the timeout setting I wrote in the axios initialization, which is 5000 milliseconds. Therefore, the real request couldn’t be sent, and then I encountered the provisional headers are shown problem.
Solution: When it comes to OPTIONS request, backend api just return result, it makes the request faster and the real request can be sent before timeout.

answered Jan 9, 2018 at 6:41

Alessia's user avatar

AlessiaAlessia

84110 silver badges15 bronze badges

This can also happen (for cross-origin requests only) because of a new feature called site isolation

This page details the issue and a work-around. Which is to go to chrome://flags/#site-isolation-trial-opt-out in chrome and change that setting to «Opt-out» and reload chrome.

It’s a known issue. However that page says it’s fixed in chrome 68, but I’m running chrome 68 and I still have the issue.

jakub.g's user avatar

jakub.g

38k11 gold badges92 silver badges129 bronze badges

answered Aug 14, 2018 at 20:00

onlynone's user avatar

onlynoneonlynone

7,5423 gold badges30 silver badges50 bronze badges

2

HTTP/2 Pushed resources will produce Provisional headers are shown in the inspector for the same theory as @wvega posted in his answer above.

e.g: Since the server pushed the resource(s) to the client (before the client requested them), the browser has the resources cached and therefore the client never makes/needs a requests; So because…

…the real headers are updated when the server responds, but there is no response if the request was blocked.

Community's user avatar

answered Dec 16, 2015 at 18:00

I doubt my answer is in time to help you but others might find it helpful. I experienced a similar issue with a jQuery Ajax Post script that i created.

It turned out that i had a typo in the href attribute of the A tag that i was using to fire the post. I had typed href=»javacsript:;» (reversing the ‘s’ and the ‘c’ ).. this caused the script to try to refresh the page while the post was attempting to fire. corrected the typo and it worked perfectly fine for me.

answered Mar 2, 2014 at 14:01

Savage's user avatar

1

This message can occur when the website is protected using HSTS. Then, when someone links to the HTTP version of the URL, the browser, as instructed by HSTS, does not issue an HTTP request, but internally redirects to the HTTPS resource securely. This is to avoid HTTPS downgrade attacks such as sslstrip.

answered Oct 18, 2015 at 14:52

dionyziz's user avatar

dionyzizdionyziz

2,3941 gold badge23 silver badges29 bronze badges

2

A common reason this happens is if you are tracking an event and you don’t prevent the default action. For example, if you have a click event, then you will want to include:

e.preventDefault();

or

return false;

If you don’t, you will see the provisional headers warning as well as a «canceled» status in the Network tab of your web console.

answered May 28, 2014 at 20:55

bigtex777's user avatar

bigtex777bigtex777

1,15010 silver badges15 bronze badges

0

This issue occurred to me when I was sending an invalid HTTP Authorization header. I forgot to base64 encode it.

answered Jan 29, 2016 at 20:00

Robert Christopher's user avatar

1

That might because you sent an Ajax request, at the same time you jump your page to another one using location.href or something like that. So the previous request failed.

answered Aug 29, 2018 at 7:39

Frankjs's user avatar

FrankjsFrankjs

5651 gold badge4 silver badges14 bronze badges

This caution message also occurs if the response is invalid and therefore dropped by the browser.

In my case the request was correctly sent to the server, the server-side code then produced an error and my custom error handling returned the error message in the HTTP status message field. But this error was not received on the client side, due to invalid characters in the error message (described here http://aspnetwebstack.codeplex.com/workitem/1386) which resulted in corrupt response headers.

answered Feb 14, 2014 at 8:35

Florian Haider's user avatar

I ran into this issue with an AJAX call that would never complete. I followed wvega’s advice and tip about debugging with chrome://net-internals to eventually determine another click event handler in the page, listening on a parent node, was causing the browser to navigate to the same URL (so it wasn’t easily noticeable).

The solution was to add event.stopPropagation() in a click handler on the form submit button to keep the click from bubbling up the DOM and canceling the AJAX request in progress (initiated via a submit handler on the form).

answered Mar 11, 2014 at 22:42

jimp's user avatar

jimpjimp

16.9k3 gold badges26 silver badges35 bronze badges

I’ve had this come up very recently (today in fact) where I’ve had an AJAX call go out to the server and Chrome fires off the «Caution: Provisional headers are shown.» In the server side PHP scripting, there are MySQL queries that can be pretty much instant or take a few seconds depending on the given scenario. My server response isn’t sent back to the browser until the queries are completed. I’ve found I get this error only when time consuming queries (up to a few seconds total) are being done and prevent the response from being sent back.

My scenario involves the very rare possibility of having to alter a table by adding/removing hundreds of columns for weather model output…hence the response lag from iterating through a loop of ALTER TABLE queries.

answered Apr 17, 2014 at 18:38

Gwi7d31's user avatar

Gwi7d31Gwi7d31

1,6422 gold badges12 silver badges10 bronze badges

1

In my case it was just a false set path in to a resource (svg / img)

answered Jan 25, 2015 at 14:39

typocoder's user avatar

typocodertypocoder

3451 gold badge3 silver badges10 bronze badges

1

Use this code fist of your code:

header('Cache-Control: no-cache, no-store, must-revalidate');
header('Pragma: no-cache');
header('Expires: 0');

This works for me.

answered Nov 13, 2017 at 15:02

Nabi K.A.Z.'s user avatar

Nabi K.A.Z.Nabi K.A.Z.

9,6386 gold badges57 silver badges79 bronze badges

3

The reason why this header shows is that: your request don’t send to remote.

It usually caused by

  1. Extension has blocks your request
  2. Chrome use own cache to fetch your resource

Chrome cannot get your request headers from a request that haven’t made.

A recent version of chrome has indicate these:

Only Provisional headers are avaliable because this request was not sent over the network and instead was served from a local cache,
which doesn’t store the original request headers.

Disable cache to see full request headers

answered Sep 15, 2020 at 9:17

nuclear's user avatar

nuclearnuclear

3,1513 gold badges19 silver badges38 bronze badges

I came across this and it went away when I switched from https to http. The SSL certs we use in dev aren’t verified by a 3rd party. They’re just locally generated dev certs.

The same calls work just fine in Chrome Canary and Firefox. These browsers don’t appear to be as strict about the SSL cert as Chrome is. The calls would fail in Chrome with the «CAUTION: Provisional headers…» message.

I think/hope that when we use a legit SSL cert in stage and prod, we won’t see this behavior in Chrome anymore.

answered Feb 19, 2014 at 21:02

CodeWarrior's user avatar

CodeWarriorCodeWarrior

3323 silver badges9 bronze badges

1

Just throwing in my two cents. I’m writing a Web Application using CORS requests and a full RESTful web service. I have found chrome will throw this error when I have an unhanded exception or a PHP Error thrown. Just incase anyone else runs into the problem. I found that when this happens I can fire up the Chrome App «Postman — Rest Client» and run the exact same request but in the Chrome App I’ll actually get the PHP Error thats being thrown instead of this non descriptive error.

answered Mar 3, 2014 at 18:09

JDubDev's user avatar

JDubDevJDubDev

1741 silver badge8 bronze badges

I ran this issue when I tried to load main.js for require js for the second time after I made changes as a result from error .
I just turned on in Developer Tools Settings «Disable Cache (When DevTools is Open)» .
and that did the charm.

answered Mar 11, 2014 at 22:53

Ohad Sadan's user avatar

Ohad SadanOhad Sadan

8776 silver badges15 bronze badges

1

Another possible scenario I’ve seen — the exact same request is being sent again just after few milliseconds (most likely due to a bug in the client side).
In that case you’ll also see that the status of the first request is «canceled» and that the latency is only several milliseconds.

answered Apr 16, 2014 at 11:27

Erez Cohen's user avatar

Erez CohenErez Cohen

1,4971 gold badge16 silver badges25 bronze badges

This was happening for me, when I had a download link and after clicking on it I was trying also to catch the click with jquery and send an ajax request. The problem was because when you are clicking on the download link, you are leaving the page, even it does not look so. If there would no file transfer, you would see the requested page.. So I set a target=»_blank» for preventing this issue.

answered May 14, 2014 at 6:41

Hayk Aghabekyan's user avatar

I got this error when I tried to print a page in a popup. The print dialog was show and it still waiting my acceptance or cancellation of the printing in the popup while in the master page also was waiting in the background showing the message CAUTION provisional headers are shown when I tried to click another link.

In my case the solution was to remove the window.print (); script that it was executing on the <body> of the popup window to prevent the print dialog.

answered May 25, 2014 at 18:56

Arnau Galofré's user avatar

I saw this occur when the number of connections to my server exceeded Chrome’s max-connections-per-server limit of 6.

answered Mar 23, 2017 at 12:48

mab's user avatar

mabmab

7404 silver badges17 bronze badges

In my case the cause was AdBlock extension.

The request to server went through and I got the response but I could not see the request cookies due to «Provisional headers..» being shown in Dev tools. After disabling AdBlock for the site, the warning went away and dev tools started to show the cookies again.

For the change to take effect, it was also necessary to close the Dev tools and refresh the page

answered Apr 1, 2019 at 10:20

Tarmo's user avatar

TarmoTarmo

1,11613 silver badges28 bronze badges

Here is another solution.

If you encounter this issue with $ajax() call, add http:// before your serverhost will solve your problem.

var requestURL = "http://" + serverHost;
$.ajax({
    dataType: "json",
    url: requestURL,
    data: data,
    success: success    
});

answered Mar 8, 2014 at 20:58

KTU's user avatar

KTUKTU

4354 silver badges15 bronze badges

If you are developing an Asp.Net Mvc application and you are trying to return a JsonResult in your controller, make sure you add JsonRequestBehavior.AllowGet to the Json method. That fixed it for me.

public JsonResult GetTaskSubCategories(int id)
{
    var subcategs = FindSubCategories(id);

    return Json(subcategs, JsonRequestBehavior.AllowGet);  //<-- Notice it has two parameters
}

answered Jun 1, 2014 at 13:11

codingbiz's user avatar

codingbizcodingbiz

26.1k8 gold badges57 silver badges95 bronze badges

«Caution: provisional headers are shown» message can be shown when website hosted on HTTPS invokes a calls to WebApi hosted on HTTP. You can check all if all your Api’s are HTTPS. Browser prevents to do a call to insecure resource. You can see similar message in your code when use FETCH API to domain with HTTP.

Mixed Content: The page at ‘https://website.com’ was loaded over HTTPS, but requested an insecure resource ‘http://webapi.com’. This request has been blocked; the content must be served over HTTPS.

answered May 25, 2017 at 9:30

Rafal Cypcer's user avatar

Rafal CypcerRafal Cypcer

5571 gold badge5 silver badges17 bronze badges

I had a similar issue with my MEAN app. In my case, the issue was happening in only one get request. I tried with removing adblock, tried clearing cache and tried with different browsers. Nothing helped.

finally, I have figured out that the api was trying to return a huge JSON object. When I have tried to send a small object, it was working fine. Finally, I have changed my implementation to return a buffer instead of a JSON.

I wish expressJS to throw an error in this case.

answered Jul 24, 2017 at 8:58

chank's user avatar

chankchank

3,5061 gold badge14 silver badges22 bronze badges

If you’re familiar with Chrome DevTools, you certainly have seen the “Provisional headers are shown” warning message popped up in certain network requests.

In this article, we will explain what exactly “Provisional headers” are, and what does “Provisional headers are shown” means in Google Chrome/Chromium-based browsers.

HTTP headers are the name or value pairs that are displayed in the request and response messages of message headers for Hypertext Transfer Protocol (HTTP). Request headers contain more information about the resource to be fetched, or about the client requesting the resource. Response headers hold additional information about the response, like its location or about the server providing it. These headers are usually invisible to the end-user and are only processed or logged by the server and client applications.

HTTP Headers displayed for pending requests are provisional. They represent what request was sent from Blink to Chromium/Chrome. To those of you who didn’t know, Blink is the open-source browser layout engine that powers Chromium (and therefore Chrome as well).

Chromium/Chrome do not update headers until server responds to avoid additional notification used only by DevTools. In short, provisional headers mean the requests they are not yet responded to. Please do note that this is just a notification, not an actual error message.

If the request is meant to be responded properly, but in reality, “Provisional headers are shown” are displayed, it’s usually because one of these reasons:

  • An extension has blocked your request
  • Chrome use its own cache to fetch your resource. The request was not sent over the network and instead was served from a local cache, which doesn’t store the original request headers.
  • Internal error which made Chrome cannot get your request headers from a request that haven’t made.

Check your adblockers

One of the most common reasons that causes “Provisional headers are shown” are Chrome extensions. The resource you’re trying to load could be being blocked by an extension, usually ad-blockers such as AdBlock, uBlock Origin or Adguard.

Most adblockers work the same way, which is blocking the requests based on pattern matching. If an URL contains the word “advert”, “ads” or something similar, it would be blocked from loading.

In order to make “Provisional headers are shown” disappear, you’ll have to whitelist the URL out of adblockers block list. Below are instructions on how to do that with popular extensions like Adblock Plus and uBlock Origin.

Whitelist your site from Adblock Plus

  1. Navigate to the URL which have been blocked and shown “Provisional headers are shown”.
  2. Click on the AdBlock Plus icon in the Chrome toolbar. If you don’t see the icon, it may be hidden by Chrome/Chromium itself. Clicking the “jigsaw” icon will bring you the full list of all installed extensions.
  3. Click the toggle in Block ads on this website section to whitelist the whole domain out of Adblock Plus blocklist. Alternatively, you can whitelist only the URL you’re visiting by clicking the smaller toggle on This page section.

Whitelist your site from uBlock Origin

  1. Navigate to the URL which have been blocked and shown “Provisional headers are shown”.
  2. uBlock circumvents immediately and show you a message which notify you that the URL has been blocked. You can either click Temporarily to unblock the URL until you close the browser, or click Permanently to unblock the URL forever.

Find the troublesome extension (Advanced)

In case your adblocker isn’t the cause of the error, there might be another extension interfering with the request-response cycle.

In order to pinpoint the exact troublesome extension, you have to use Chrome net-internals tools. How to access the tool depends on which version of Chromium/Chrome you’re using.

Latest Versions of Chrome

  • Navigate to chrome://net-export/.
  • Click Start Logging to Disk to save the logs to the hard drive. The button should change to Stop Logging
  • Open the page that is was thrown “Provisional Headers are shown”.
  • Go back to net-export page and click Stop Logging.
  • Go to https://netlog-viewer.appspot.com/#import and drag-drop the log file you’ve just saved into the webpage.
  • Click on Events (###) section in the sidebar and use the input box to find the event related to your resource (tips: use parts of the URL as search query).
  • Finally, click on the event and see if the info shown tells you something interesting.

For Older Versions of chrome

  • Type chrome://net-internals in the address bar and hit enter.
  • Open the page that is showing problems.
  • Go back to net-internals, click on Events (###) and search using input box to find the event related to your resource.
  • Finally, click on the event and see if the info shown tells you something. From these information, you can pinpoint exactly what happened and if there’s any extension breaks the request-response cycle.

Disable site isolation/network service

“Provisional Headers are shown” can also happen (for cross-origin requests only) because of a Chrome feature called site isolation. If none of the above methods work for you, you may have to try messing with site isolation/network service.

First, open up the Disable site isolation setting by navigating to chrome://flags/#chrome://flags#Disable%20site%20isolation and disable it.

Then, open up Enable Network Service setting by navigating to chrome://flags/#chrome://flags#Enable%20network%20service, and disable that:

Once you’re done, relaunch the browser and check if the issue still persists. In a few cases, users have reported that disabling cache in Chrome DevTools also help.

Alternatively, you can start Chrome with the aforementioned settings disabled by running the following command (either in Command Prompt or Linux terminal):

chrome --disable-site-isolation-trials --disable-features=NetworkService,NetworkServiceInProcess

We hope that the article offer useful information about “Provisional headers are shown” notification in Chromium/Chrome.

We’ve also written a few other guides for fixing common Chrome errors, such as Fix ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION error in Google Chrome/Microsoft Edge, Fix “Requests to the server have been blocked by an extension” in Chrome/Microsoft Edge or Fix “Access to XMLHttpRequest has been blocked by CORS policy” in Chrome . If you have any suggestion, please feel free to leave a comment below.

4b9b3361

Ответ 1

Ресурс может быть заблокирован расширением (в моем случае AdBlock).

Сообщение пришло, потому что запрос на получение этого ресурса никогда не был сделан, поэтому отображаемые заголовки не являются реальными. Как объяснялось в проблеме, на которую вы ссылались, реальные заголовки обновляются, когда сервер отвечает, но нет ответа, если запрос был заблокирован.


Я узнал о расширении, которое блокировало мой ресурс, с помощью инструмента net-internals в Chrome:

Для последних версий Chrome

  • Введите chrome://net-export/ в адресной строке и нажмите ввод.
  • Начать запись. И сохраните файл записи на локальном компьютере.
  • Откройте страницу с проблемами.
  • Вернуться к net-internals
  • Вы можете просмотреть Записанный файл журнала здесь https://netlog-viewer.appspot.com/#import
  • нажмите events (###) и используйте текстовое поле, чтобы найти событие, связанное с вашим ресурсом (используйте части URL).
  • Наконец, нажмите на событие и посмотрите, говорит ли вам что-то показанная информация.

Для старых версий хрома

  • Введите chrome://net-internals в адресной строке и нажмите ввод.
  • Откройте страницу с проблемами.
  • Вернитесь к net-internals, нажмите events (###) и используйте текстовое поле, чтобы найти событие, связанное с вашим ресурсом (используйте части URL).
  • Наконец, нажмите на событие и посмотрите, говорит ли вам что-то показанная информация.

Ответ 2

Я считаю, что это происходит, когда фактический запрос не отправляется. Обычно происходит при загрузке кэшированного ресурса.

Ответ 3

Для хрома v72+ это решило только для меня следующее:

перейдите в chrome://flags/ и отключите эти 3 флага

  • Отключить изоляцию сайта
  • Включить сетевой сервис
  • Запускает сетевой сервис в процессе

enter image description here

или вы можете сделать это из командной строки:

chrome --disable-site-isolation-trials --disable-features=NetworkService,NetworkServiceInProcess

почему это случилось?

Похоже, что Google реорганизует свой движок Chromium в модульную структуру, где различные сервисы будут разделены на отдельные модули и процессы. Они называют этот процесс обслуживанием. Сетевой сервис — это первый шаг, сервис Ui, сервис идентификации и сервис устройств. Google предоставляет официальную информацию на сайте проекта Chromium.

опасно ли это изменить?

Примером является сетевое взаимодействие: когда у нас есть сетевой сервис, мы можем выбрать его запуск вне процесса для лучшей стабильности/безопасности или внутрипроцессного, если мы ограничены в ресурсах. источник

Ответ 4

Я столкнулся с этой проблемой, и мне удалось определить конкретную причину, которая не упоминается выше ни в ответах, ни в вопросе.

Я запускаю полный стек js, angular front end и node back end на SSL, а API находится в другом домене, запущенном на порту 8081, поэтому я делаю запросы CORS и withCredentials, когда я отбрасываю cookie сеанса из API

Таким образом, в первую очередь мой сценарий был: POST-запрос, withCredentials на порт 8081 вызвал сообщение «ПРЕДОСТЕРЕЖЕНИЕ: предварительные заголовки показаны» в инспекторе, а также, конечно же, заблокировал запрос вместе.

Мое решение состояло в том, чтобы настроить apache на прокси-сервер, передав запрос с обычного порта SSL 443 на порт node SSL 8081 (node должен быть на более высоком порту, поскольку он не может быть запущен с правами root в прод). Поэтому я думаю, что Chrome не любит запросы SSL к нетрадиционным портам SSL, но, возможно, их сообщение об ошибке может быть более конкретным.

Ответ 5

Это также может произойти (только для запросов из разных источников) из-за новой функции, называемой изоляцией сайта

.На этой странице подробно описывается проблема и возможное решение. Для этого перейдите к chrome://flags/#site-isolation-trial-opt-out в Chrome, измените этот параметр на «Отказ» и перезагрузите Chrome.

Это известная проблема. Однако на этой странице написано, что она исправлена в Chrome 68, но я использую Chrome 68 и у меня все еще есть проблема.

Ответ 6

HTTP/2 Pushed resources создаст Provisional headers are shown в инспекторе для той же теории, что и @wvega, опубликованный в его ответе выше.

, например:. Так как сервер подтолкнул ресурс к клиенту (до того, как клиент запросил их), браузер имеет ресурсы, кэшированные и, следовательно, клиент никогда не делает/не требует запросов; Так что…

… реальные заголовки обновляются, когда сервер отвечает, но нет ответа, если запрос был заблокирован.

Ответ 7

Моя ситуация связана с кросс-происхождением.
Ситуация: браузер отправляет запрос OPTIONS перед отправкой реального запроса, например GET или POST. Разработчик backend забывает обрабатывать запрос OPTIONS, позволяя ему пройти через служебный код, делая слишком длительным время обработки. Дольше, чем тайм-аут, который я написал в инициализации axios, что составляет 5000 миллисекунд. Поэтому реальный запрос не может быть отправлен, а затем я столкнулся с provisional headers are shown проблему.
Решение. Когда дело доходит до запроса OPTIONS, backend api просто возвращает результат, он ускоряет запрос и реальный запрос может быть отправлен до истечения таймаута.

Ответ 8

Я сомневаюсь, что мой ответ вовремя поможет вам, но другие могут оказаться полезными. Я столкнулся с аналогичной проблемой с созданным мной jQuery Ajax Post script.

Оказалось, что у меня была опечатка в атрибуте href тега A, который я использовал для запуска сообщения. Я набрал href= « javacsript:;» (изменение «s» и «c» ). Это привело к тому, что script попытался обновить страницу во время попытки записи. скорректировал опечатку, и это сработало отлично для меня.

Ответ 9

Это сообщение может появляться, когда веб-сайт защищен с помощью HSTS. Затем, когда кто-то ссылается на HTTP-версию URL-адреса, браузер, как указано HSTS, не выдает HTTP-запрос, а внутренне перенаправляет на HTTPS-ресурс. Это делается для того, чтобы избежать атак с понижением HTTPS, таких как sslstrip.

Ответ 10

Это может произойти из-за того, что вы отправили запрос Ajax, и в то же время вы перешли на другую страницу, используя location.href или что-то в этом роде. Так что предыдущий запрос не удался.

Ответ 11

Это предупреждение также возникает, если ответ недействителен и поэтому брошен браузером.

В моем случае запрос был правильно отправлен на сервер, тогда код на стороне сервера выдал ошибку, и моя пользовательская обработка ошибок вернула сообщение об ошибке в поле сообщения HTTP-статуса. Но эта ошибка не была получена на стороне клиента из-за недопустимых символов в сообщении об ошибке (здесь описано http://aspnetwebstack.codeplex.com/workitem/1386), что привело к повреждению ответа заголовки.

Ответ 12

Я столкнулся с этой проблемой с вызовом AJAX, который никогда не завершится. Я следил за советом wvega и советом об отладке с chrome://net-internals, чтобы в конечном итоге определить другой обработчик событий click на странице, прослушивание родительского node, заставляя браузер перейти к тому же URL-адресу (так что это было нелегко заметно).

Решение заключалось в том, чтобы добавить event.stopPropagation() в обработчик click на кнопку отправки формы, чтобы не допустить, чтобы щелчок запустил DOM и отменил выполняемый запрос AJAX (инициирован с помощью обработчика submit на form).

Ответ 13

У меня это появилось совсем недавно (сегодня на самом деле), где у меня был вызов AJAX, выходящий на сервер, и Chrome срабатывает «Предупреждение: отображаются предварительные заголовки». В сценариях на стороне сервера PHP есть MySQL-запросы, которые могут быть довольно мгновенными или занимать несколько секунд в зависимости от данного сценария. Ответ моего сервера не отправляется обратно в браузер до тех пор, пока запросы не будут завершены. Я обнаружил, что получаю эту ошибку только в том случае, когда выполняются длительные запросы (до нескольких секунд) и не дают ответа отсылаться обратно.

Мой сценарий включает очень редкую возможность изменить таблицу, добавив/удалив сотни столбцов для вывода погодной модели… следовательно, отставание ответа от итерации через цикл запросов ALTER TABLE.

Ответ 14

Общей причиной этого является то, что вы отслеживаете событие и не предотвращаете действие по умолчанию. Например, если у вас есть событие click, то вы захотите включить:

e.preventDefault();

или

return false;

Если вы этого не сделаете, вы увидите предупреждение предварительных заголовков, а также «отмененный» статус на вкладке «Сеть» на своей веб-консоли.

Ответ 15

В моем случае это был всего лишь ложный путь к ресурсу (svg/img)

Ответ 16

Эта проблема возникла, когда я отправил недопустимый заголовок HTTP-авторизации. Я забыл base64 закодировать его.

Ответ 17

Я наткнулся на это, и он ушел, когда я переключился с https на http. Сертификаты SSL, которые мы используем в dev, не проверяются сторонними лицами. Они только локально созданы dev certs.

Те же звонки отлично работают в Chrome Canary и Firefox. Эти браузеры, похоже, не столь строгие относительно сертификата SSL, как Chrome. Вызовы завершились с ошибкой в ​​Chrome с сообщением «ПРЕДУПРЕЖДЕНИЕ: Предварительные заголовки…».

Я думаю/надеюсь, что когда мы используем законный SSL-сертификат в стадии и prod, мы больше не увидим это поведение в Chrome.

Ответ 18

Я запустил эту проблему, когда попытался загрузить main.js для вызова js во второй раз после внесения изменений в результате ошибки.
Я только что включил «Настройки разработчика» «Отключить кеш (когда DevTools открыт)».
и это сделало очарование.

Ответ 19

Еще один возможный сценарий, который я видел, — тот же самый запрос отправляется снова через несколько миллисекунд (скорее всего, из-за ошибки на стороне клиента).
В этом случае вы также увидите, что статус первого запроса «отменен» и что время ожидания составляет всего несколько миллисекунд.

Ответ 20

Это происходило для меня, когда у меня была ссылка для загрузки, и после нажатия на нее я также пытался поймать клик с помощью jquery и отправить запрос ajax. Проблема заключалась в том, что когда вы нажимаете на ссылку для загрузки, вы покидаете страницу, даже если она не выглядит так. Если файл не будет передан, вы увидите запрошенную страницу. Поэтому я поставил цель = «_ blank» для предотвращения этой проблемы.

Ответ 21

Я получил эту ошибку, когда попытался распечатать страницу во всплывающем окне. Диалоговое окно печати было показано, и оно все еще ожидает моего принятия или отмены печати во всплывающем окне, а на главной странице также ожидалось в фоновом режиме, показывая сообщение ПРЕДОСТЕРЕЖЕНИЕ предварительные заголовки отображаются, когда я пытался щелкнуть другое соединение.

В моем случае решение заключалось в том, чтобы удалить window.print (); script, который он выполнял во <body> всплывающего окна, чтобы предотвратить диалог печати. ​​

Ответ 22

Я видел, что это произошло, когда количество подключений к моему серверу превысило максимальный уровень Chrome max-connections-per-server 6.

Ответ 23

Используйте этот код кода вашего кода:

header('Cache-Control: no-cache, no-store, must-revalidate');
header('Pragma: no-cache');
header('Expires: 0');

Это работает для меня.

Ответ 24

Просто бросаю мои два цента. Я пишу веб-приложение, используя запросы CORS и полный веб-сервис RESTful. Я обнаружил, что хром будет выкидывать эту ошибку, когда у меня есть неполученное исключение или ошибка PHP. Просто запустите кого-нибудь другого в проблему. Я обнаружил, что когда это произойдет, я могу запустить приложение Chrome «Postman — Rest Client» и запустить тот же запрос, но в приложении Chrome я фактически получаю ошибку PHP, которая будет выбрана вместо этой не описательной ошибки.

Ответ 25

Вот еще одно решение.

Если вы столкнулись с этой проблемой при вызове $ajax(), добавьте http://, прежде чем ваш сервер будет решить вашу проблему.

var requestURL = "http://" + serverHost;
$.ajax({
    dataType: "json",
    url: requestURL,
    data: data,
    success: success    
});

Ответ 26

Если вы разрабатываете приложение Asp.Net Mvc и пытаетесь вернуть JsonResult в свой контроллер, добавьте JsonRequestBehavior.AllowGet в метод Json. Это исправило это для меня.

public JsonResult GetTaskSubCategories(int id)
{
    var subcategs = FindSubCategories(id);

    return Json(subcategs, JsonRequestBehavior.AllowGet);  //<-- Notice it has two parameters
}

Ответ 27

«Предупреждение: предварительные заголовки показаны» сообщение может быть показано, когда веб-сайт, размещенный в HTTPS, вызывает вызовы WebApi, размещенные по протоколу HTTP. Вы можете проверить все, если все ваши Api — HTTPS. Браузер предотвращает вызов ненадежного ресурса. Вы можете увидеть подобное сообщение в своем коде, когда используете API FETCH для домена с HTTP.

Смешанный контент: страница с надписью https://website.com ‘была загружена через HTTPS, но запросила небезопасный ресурс’ http://webapi.com ‘. Этот запрос заблокирован; содержимое должно быть передано через HTTPS.

Ответ 28

У меня была аналогичная проблема с моим MEAN-приложением. В моем случае проблема происходила только в одном запросе на получение. Я попытался с удалением adblock, попробовал очистить кеш и пробовал с разными браузерами. Ничего не помогло.

Наконец, я понял, что api пытается вернуть огромный объект JSON. Когда я пытался отправить небольшой объект, он работал нормально. Наконец, я изменил свою реализацию, чтобы вернуть буфер вместо JSON.

Я хочу выразить JS, чтобы вывести ошибку в этом случае.

Ответ 29

Очищенные кэшированные данные из истории браузера работают для меня.

Ответ 30

Эта проблема также возникает при использовании некоторых пакетов, таких как webpack-hot-middleware и одновременно открывающих несколько страниц. webpack-hot-middleware создаст соединение для каждой страницы для прослушивания изменений кода, а затем обновит страницу. Каждый браузер имеет ограничение на max-connections-per-server которое составляет 6 для Chrome, поэтому, если вы уже открыли более 6 страниц в Chrome, новый запрос будет зависеть там, пока вы не закроете некоторые страницы.

Recently I worked on a PHP webservice project and I saw this

in Google chrome browser and Opera browser.
I digged some research on Google and find out mixed responses and at last I got it fixed by removing window.print() in script.
Check out all the fixed Provisional headers are shown answers from stackoverflow.

Few developers say that it is because of Chrome plugins like Adblock and VPN. Anyways check out all the responses.

The resource could be being blocked by an extension (AdBlock in my case).

The message is there because the request to retrieve that resource was never made, so the headers being shown are not the real thing. As explained in the issue you referenced, the real headers are updated when the server responds, but there is no response if the request was blocked.

I believe it happens when the actual request is not sent. Usually happens when you are loading a cached resource.

I had similar problem. I changed my button type=”submit” to type=”button”. It worked for me.

I’ve faced with the same issue while working through VPN. To solve the problem had to change the MTU value.

I encountered this issue, and I managed to identify a specific cause, which isn’t mentioned above either in answers or the question.

I am running a full js stack, angular front end and node back end on SSL, and the API is on a different domain running on port 8081, so I am doing CORS requests and withCredentials as I am dropping a session cookie from the API

So specifically my scenario was: POST request, withCredentials to port 8081 caused the “CAUTION: provisional headers are shown” message in the inspector and also of course blocked the request all together.

My solution was to set up apache to proxy pass the request from the usual SSL port of 443 to the node SSL port of 8081 (node has to be on a higher port as it cannot be ran as root in prod). So I guess Chrome doesn’t like SSL requests to unconventional SSL ports, but perhaps their error message could be more specific.

This caution message also occurs if the response is invalid and therefore dropped by the browser.

In my case the request was correctly sent to the server, the server-side code then produced an error and my custom error handling returned the error message in the HTTP status message field. But this error was not received on the client side, due to invalid characters in the error message (described here http://aspnetwebstack.codeplex.com/workitem/1386) which resulted in corrupt response headers.

I came across this and it went away when I switched from https to http. The SSL certs we use in dev aren’t verified by a 3rd party. They’re just locally generated dev certs.

The same calls work just fine in Chrome Canary and Firefox. These browsers don’t appear to be as strict about the SSL cert as Chrome is. The calls would fail in Chrome with the “CAUTION: Provisional headers…” message.

I think/hope that when we use a legit SSL cert in stage and prod, we won’t see this behavior in Chrome anymore.

I doubt my answer is in time to help you but others might find it helpful. I experienced a similar issue with a jQuery Ajax Post script that i created.

It turned out that i had a typo in the href attribute of the A tag that i was using to fire the post. I had typed href=”javacsript:;” (reversing the ‘s’ and the ‘c’ ).. this caused the script to try to refresh the page while the post was attempting to fire. corrected the typo and it worked perfectly fine for me.

Just throwing in my two cents. I’m writing a Web Application using CORS requests and a full RESTful web service. I have found chrome will throw this error when I have an unhanded exception or a PHP Error thrown. Just incase anyone else runs into the problem. I found that when this happens I can fire up the Chrome App “Postman – Rest Client” and run the exact same request but in the Chrome App I’ll actually get the PHP Error thats being thrown instead of this non descriptive error.

Here is another solution.

If you encounter this issue with $ajax() call, add http:// before your serverhost will solve your problem.

var requestURL = “http://” + serverHost; $.ajax({ dataType: “json”, url: requestURL, data: data, success: success });

I ran into this issue with an AJAX call that would never complete. I followed wvega’s advice and tip about debugging with chrome://net-internals to eventually determine another click event handler in the page, listening on a parent node, was causing the browser to navigate to the same URL (so it wasn’t easily noticeable).

The solution was to add event.stopPropagation() in a click handler on the form submit button to keep the click from bubbling up the DOM and canceling the AJAX request in progress (initiated via a submit handler on the form).

I ran this issue when I tried to load main.js for require js for the second time after I made changes as a result from error . I just turned on in Developer Tools Settings “Disable Cache (When DevTools is Open)” . and that did the charm.

Another possible scenario I’ve seen – the exact same request is being sent again just after few milliseconds (most likely due to a bug in the client side).
In that case you’ll also see that the status of the first request is “canceled” and that the latency is only several milliseconds.

I’ve had this come up very recently (today in fact) where I’ve had an AJAX call go out to the server and Chrome fires off the “Caution: Provisional headers are shown.” In the server side PHP scripting, there are MySQL queries that can be pretty much instant or take a few seconds depending on the given scenario. My server response isn’t sent back to the browser until the queries are completed. I’ve found I get this error only when time consuming queries (up to a few seconds total) are being done and prevent the response from being sent back.

My scenario involves the very rare possibility of having to alter a table by adding/removing hundreds of columns for weather model output…hence the response lag from iterating through a loop of ALTER TABLE queries.

This was happening for me, when I had a download link and after clicking on it I was trying also to catch the click with jquery and send an ajax request. The problem was because when you are clicking on the download link, you are leaving the page, even it does not look so. If there would no file transfer, you would see the requested page.. So I set a target=”_blank” for preventing this issue.

I got this error when I tried to print a page in a popup. The print dialog was show and it still waiting my acceptance or cancellation of the printing in the popup while in the master page also was waiting in the background showing the message CAUTION provisional headers are shown when I tried to click another link.

In my case the solution was to remove the window.print (); script that it was executing on the body tag of the popup window to prevent the print dialog.

A common reason this happens is if you are tracking an event and you don’t prevent the default action. For example, if you have a click event, then you will want to include:

e.preventDefault();
or

return false;
If you don’t, you will see the provisional headers warning as well as a “canceled” status in the Network tab of your web console.

If you are developing an Asp.Net Mvc application and you are trying to return a JsonResult in your controller, make sure you add JsonRequestBehavior.AllowGet to the Json method. That fixed it for me.

public JsonResult GetTaskSubCategories(int id) { var subcategs = FindSubCategories(id); return Json(subcategs, JsonRequestBehavior.AllowGet); //< Notice it has two parameters } When chrome redirect to a new url, some http requests will be canceled immediatly, you will find ‘provisional headers are shown’ in debug console.

Above anwers are took from stackoverflow and other sites for only informational purpose.

Based on your response, I have modified the test case. The request from TestWorker.js is now to a different endpoint that
has NEVER been hit before:

starter.js

// open background page devTools
chrome.developerPrivate.openDevTools({
    renderViewId    : -1,
    renderProcessId : -1,
    extensionId     : chrome.runtime.id
});

// timeout just to let devTools open before making requests
setTimeout(() => {
    fetch('https://reqbin.com/echo/get/json')
        .then(response => response.json())
        .then(response => {
            console.log('background page response', response);
        });

    new Worker('TestWorker.js');
}, 6000)

TestWorker.js

fetch('https://jsonplaceholder.typicode.com/posts/3')
    .then(response => response.json())
    .then(response => {
        console.log('worker response', response);
    });

The problem persists, as the worker request still shows the provisional headers message.

You can see in this screenshot of devTools that the first request is now cached (size column shows «(disk cache)»), as we have made it before. The second request from the worker indicates that it is NOT from cache, as it has the size.
devtools1

Looking at the details for the first request, you will see «Provisional headers are show. Disable cache to see full headers»:
devtools2

Now looking at the details for the second request, we see a slightly different message, «Provisional headers are shown», but nothing about caching:
devtools3

We have also run a proxy to confirm that the worker request is actually going out.

Here is another test case, in which I have turned on the «Disable cache (while DevTools is open)» option in settings. I make the same request twice from the background page, and a third time from the worker:

starter.js

setTimeout(() => {
    fetch('https://reqbin.com/echo/get/json')
        .then(response => response.json())
        .then(response => {
            console.log('background page response 1', response);

            fetch('https://reqbin.com/echo/get/json')
                .then(response => response.json())
                .then(response => {
                    console.log('background page response 2', response);

                    new Worker('TestWorker.js');
                });
        });

}, 3000)

TestWorker.js

fetch('https://reqbin.com/echo/get/json')
    .then(response => response.json())
    .then(response => {
        console.log('worker response', response);
    });

Now, none of the requests show «(disk cache)» in the size column:
devtools4

Details on the background page requests DO NOT show provisional headers warning, as expected:
devtools5

BUT, looking at the details for the request made from the worker, it still shows «Provisional headers are shown»:
devtools6

In conclusion, we are confident the worker request is not cached, yet the provisional headers message is still shown. We are unable to get accurate details on the headers when this message is present.

  • Province upd произошла одна или несколько ошибок
  • Provider sql network interfaces error 50 произошла ошибка local database runtime
  • Provider sql network interfaces error 26 ошибка при обнаружении указанного сервера или экземпляра
  • Prototype2engine dll ошибка что делать
  • Prototype 2 ошибка сохранения