最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

javascript - Provisional headers are shown and pending requests - Stack Overflow

matteradmin4PV0评论

I have a problem with vue-resource causing a Provisional headers are shown on Chrome, using jQuery on the other hand work without any problem

The problem only happens with Chrome + vue-resource

Reproduction Link

Chrome 57.0.2987 Windows 7

I don't have adblock or origin installed, and it happen even on guest mode on Chrome

A simple call set with setInterval

new Vue({

  el: '#main',

  data: {
    summary: null
  },
        methods: {
            updateSummary: function() {
      /*
                $.post( "summary.php", function( data ) {
                    if(typeof response.body.summary != 'undefined'){
                        this.summary = response.body.summary;
                    }
                });
        */
                this.$http.post('summary.php').then(function(response) {
                    if(typeof response.body.summary != 'undefined'){
                        this.summary = response.body.summary;
                    }
                });
            }
      },
        mounted: function () {
            this.updateSummary();

            setInterval(function () {
                this.updateSummary();
            }.bind(this), 2000);
        }
});

/

Steps to reproduce

usually it happens when I leave the page open for a few hours

What is Expected?

A 200 code response with content served

What is actually happening?

I get a request with these headers

Request URL:http://127.0.0.1:8080/monitor/summary.php Referrer Policy:no-referrer-when-downgrade Request Headers

Provisional headers are shown Accept:application/json, text/plain, / Content-Type:application/json;charset=utf-8 Origin:http://127.0.0.1:8080 Referer:http://127.0.0.1:8080/monitor/ User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36 X-Requested-With:XMLHttpRequest

And looking at chrome://net-internals/#events the cause of failure is

85487: URL_REQUEST http://127.0.0.1:8080/monitor/summary.php Start Time: 2017-04-18 09:38:43.826

t=29028 [st= 0] +REQUEST_ALIVE [dt=24184] --> priority = "MEDIUM" --> url = "http://127.0.0.1:8080/monitor/summary.php" t=29029 [st= 1] +DELEGATE_INFO [dt=24183] --> delegate_blocked_by = "RedirectToFileResourceHandler" t=53211 [st=24183] CANCELLED --> net_error = -2 (ERR_FAILED) t=53212 [st=24184] -REQUEST_ALIVE

I have a problem with vue-resource causing a Provisional headers are shown on Chrome, using jQuery on the other hand work without any problem

The problem only happens with Chrome + vue-resource

Reproduction Link

Chrome 57.0.2987 Windows 7

I don't have adblock or origin installed, and it happen even on guest mode on Chrome

A simple call set with setInterval

new Vue({

  el: '#main',

  data: {
    summary: null
  },
        methods: {
            updateSummary: function() {
      /*
                $.post( "summary.php", function( data ) {
                    if(typeof response.body.summary != 'undefined'){
                        this.summary = response.body.summary;
                    }
                });
        */
                this.$http.post('summary.php').then(function(response) {
                    if(typeof response.body.summary != 'undefined'){
                        this.summary = response.body.summary;
                    }
                });
            }
      },
        mounted: function () {
            this.updateSummary();

            setInterval(function () {
                this.updateSummary();
            }.bind(this), 2000);
        }
});

https://jsfiddle/7vo2s8z3/1/

Steps to reproduce

usually it happens when I leave the page open for a few hours

What is Expected?

A 200 code response with content served

What is actually happening?

I get a request with these headers

Request URL:http://127.0.0.1:8080/monitor/summary.php Referrer Policy:no-referrer-when-downgrade Request Headers

Provisional headers are shown Accept:application/json, text/plain, / Content-Type:application/json;charset=utf-8 Origin:http://127.0.0.1:8080 Referer:http://127.0.0.1:8080/monitor/ User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36 X-Requested-With:XMLHttpRequest

And looking at chrome://net-internals/#events the cause of failure is

85487: URL_REQUEST http://127.0.0.1:8080/monitor/summary.php Start Time: 2017-04-18 09:38:43.826

t=29028 [st= 0] +REQUEST_ALIVE [dt=24184] --> priority = "MEDIUM" --> url = "http://127.0.0.1:8080/monitor/summary.php" t=29029 [st= 1] +DELEGATE_INFO [dt=24183] --> delegate_blocked_by = "RedirectToFileResourceHandler" t=53211 [st=24183] CANCELLED --> net_error = -2 (ERR_FAILED) t=53212 [st=24184] -REQUEST_ALIVE

Share Improve this question edited Jan 26, 2023 at 13:04 VLAZ 29.1k9 gold badges63 silver badges84 bronze badges asked May 5, 2017 at 11:15 TarikTarik 2,2814 gold badges21 silver badges26 bronze badges 4
  • Anything in your apache/nginx log? – E_p Commented May 15, 2017 at 23:32
  • nothing, the request isnt reaching the nginx – Tarik Commented May 17, 2017 at 8:59
  • @Tarik I've same issue like you on chrome 72 with vue and axios. post request does not sent. but it work on get. how to solve it? – Dedi Ananto Commented Feb 27, 2019 at 3:14
  • I didnt manage to solve it, the problem originated from having the ajax in a loop and people leaving the dashboard running overnight which break at some point – Tarik Commented Mar 13, 2019 at 16:51
Add a ment  | 

1 Answer 1

Reset to default 3

I believe this happens when the actual request is not sent, usually when you are loading a cached resource.

Basically you sent a POST request to port 8080 which caused the "CAUTION: provisional headers are shown" message as seen in the inspector and then it seems the request was blocked all together.

Based on that, one possible solution is to setup nginx to proxy pass the request from the usual SSL port of 443 to the node SSL port of 8080 (node has to be on a higher port as it cannot be ran as root in prod). I guess Chrome doesn't like SSL requests to unconventional SSL ports, though I definitely agree their error message could be more specific.

Post a comment

comment list (0)

  1. No comments so far