node-http2 icon indicating copy to clipboard operation
node-http2 copied to clipboard

No payload in GOAWAY frame

Open ghost opened this issue 9 years ago • 0 comments

I'm trying to send POST request to Apple Push Notifications server (APN). I'm getting GOAWAY frame without payload data, through APN manual states that it must contain a JSON data.

The code I'm using:

var logger = {
    fatal: noop,
    error: noop,
    warn : noop,
    info : noop,
    debug: function(data) {
        console.log(data);  //GOAWAY frame appears with no payload
    },
    trace: noop,
    child: function() { return this; }
};

var req = http2.request({
    hostname: 'api.push.apple.com',
    protocol: 'https:',
    port: 443,
    method: 'POST',
    path: '/3/device/' + deviceToken,
    agent: new http2.Agent({log: logger}),
    headers: {
        'Authorization': 'bearer ' + providerToken,
        'apns-topic': 'web.com.example'
    }
}, function(res) {
    console.log('done');
    res.pipe(process.stdout);
});
req.write(JSON.stringify(post));
req.end();

Should I do extra actions to get a payload?

Thank you very much for this module!

ghost avatar Sep 20 '16 12:09 ghost