cloudflare / netjet

Express middleware to generate preload headers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The header content contains invalid characters

bonesoul opened this issue · comments

I have tried using netjet within my project but getting the error;

    throw new TypeError('The header content contains invalid characters');
    ^

  TypeError: The header content contains invalid characters

  - _http_outgoing.js:348 ServerResponse.OutgoingMessage.setHeader
    _http_outgoing.js:348:11

  - index.js:28 appendHeader
    [buharmetre]/[netjet]/index.js:28:11

  - index.js:36
    [buharmetre]/[netjet]/index.js:36:9

  - Array.forEach

  - index.js:32 insertLinkArray
    [buharmetre]/[netjet]/index.js:32:15

  - index.js:86 BufferList._callback
    [buharmetre]/[netjet]/index.js:86:9

  - bl.js:98 BufferList.end
    [buharmetre]/[bl]/bl.js:98:10

  - _stream_readable.js:512 ServerResponse.onend
    _stream_readable.js:512:10

  - events.js:286 ServerResponse.g
    events.js:286:16

  - events.js:86 emitNone
    events.js:86:13

  - events.js:185 ServerResponse.emit
    events.js:185:7

  - _stream_readable.js:973 endReadableNT
    _stream_readable.js:973:12

  - next_tick.js:74 _combinedTickCallback
    internal/process/next_tick.js:74:11

  - next_tick.js:98 process._tickCallback
    internal/process/next_tick.js:98:9

@bonesoul that's a problem! Can you tell me what version of Node.js you're using, and what external assets are on your page?

node 6.4.0
external assets?

@bonesoul the image, javscript file, or css files on the page (since one of the has "invalid characters")

actually it's a complete project, let me strip them bit and then post here.

@bonesoul I've actually figured out what the problem is. Making the changes now.

great, i can also test it for you.

@bonesoul can you tell me if the above commit resolves the issue for you?

seems to be fixed for me :)