http2-protocol
Advanced tools
Comparing version 0.12.3 to 0.13.0
Version history | ||
=============== | ||
### 0.13.0 (2014-06-18) ### | ||
* Upgrade to the latest draft: [draft-ietf-httpbis-http2-13][draft-13] | ||
[draft-13]: http://tools.ietf.org/html/draft-ietf-httpbis-http2-13 | ||
### 0.12.3 (2014-06-15) ### | ||
@@ -5,0 +11,0 @@ |
@@ -173,3 +173,3 @@ // The implementation of the [HTTP/2 Header Compression][http2-compression] spec is separated from | ||
[ 'accept-charset' , '' ], | ||
[ 'accept-encoding' , '' ], | ||
[ 'accept-encoding' , 'gzip, deflate'], | ||
[ 'accept-language' , '' ], | ||
@@ -712,259 +712,259 @@ [ 'accept-ranges' , '' ], | ||
HuffmanTable.huffmanTable = new HuffmanTable([ | ||
'11111111111111111110111010', | ||
'11111111111111111110111011', | ||
'11111111111111111110111100', | ||
'11111111111111111110111101', | ||
'11111111111111111110111110', | ||
'11111111111111111110111111', | ||
'11111111111111111111000000', | ||
'11111111111111111111000001', | ||
'11111111111111111111000010', | ||
'11111111111111111111000011', | ||
'11111111111111111111000100', | ||
'11111111111111111111000101', | ||
'11111111111111111111000110', | ||
'11111111111111111111000111', | ||
'11111111111111111111001000', | ||
'11111111111111111111001001', | ||
'11111111111111111111001010', | ||
'11111111111111111111001011', | ||
'11111111111111111111001100', | ||
'11111111111111111111001101', | ||
'11111111111111111111001110', | ||
'11111111111111111111001111', | ||
'11111111111111111111010000', | ||
'11111111111111111111010001', | ||
'11111111111111111111010010', | ||
'11111111111111111111010011', | ||
'11111111111111111111010100', | ||
'11111111111111111111010101', | ||
'11111111111111111111010110', | ||
'11111111111111111111010111', | ||
'11111111111111111111011000', | ||
'11111111111111111111011001', | ||
'00110', | ||
'1111111111100', | ||
'111110000', | ||
'11111111111100', | ||
'111111111111100', | ||
'011110', | ||
'1100100', | ||
'1111111111101', | ||
'1111111111000', | ||
'11111111111111111011000', | ||
'1111111111111111111111100010', | ||
'1111111111111111111111100011', | ||
'1111111111111111111111100100', | ||
'1111111111111111111111100101', | ||
'1111111111111111111111100110', | ||
'1111111111111111111111100111', | ||
'1111111111111111111111101000', | ||
'111111111111111111101010', | ||
'111111111111111111111111111100', | ||
'1111111111111111111111101001', | ||
'1111111111111111111111101010', | ||
'111111111111111111111111111101', | ||
'1111111111111111111111101011', | ||
'1111111111111111111111101100', | ||
'1111111111111111111111101101', | ||
'1111111111111111111111101110', | ||
'1111111111111111111111101111', | ||
'1111111111111111111111110000', | ||
'1111111111111111111111110001', | ||
'1111111111111111111111110010', | ||
'111111111111111111111111111110', | ||
'1111111111111111111111110011', | ||
'1111111111111111111111110100', | ||
'1111111111111111111111110101', | ||
'1111111111111111111111110110', | ||
'1111111111111111111111110111', | ||
'1111111111111111111111111000', | ||
'1111111111111111111111111001', | ||
'1111111111111111111111111010', | ||
'1111111111111111111111111011', | ||
'010100', | ||
'1111111000', | ||
'1111111001', | ||
'111111111010', | ||
'1111111111001', | ||
'010101', | ||
'11111000', | ||
'11111111010', | ||
'1111111010', | ||
'111110001', | ||
'1111111011', | ||
'11111001', | ||
'11111111011', | ||
'11111010', | ||
'010110', | ||
'010111', | ||
'011000', | ||
'00000', | ||
'00001', | ||
'00010', | ||
'011001', | ||
'011010', | ||
'011011', | ||
'011100', | ||
'011101', | ||
'011110', | ||
'011111', | ||
'1011100', | ||
'11111011', | ||
'111111111111100', | ||
'100000', | ||
'111111111011', | ||
'1111111100', | ||
'1111111111010', | ||
'100001', | ||
'1011101', | ||
'1011110', | ||
'1011111', | ||
'1100000', | ||
'1100001', | ||
'1100010', | ||
'1100011', | ||
'1100100', | ||
'1100101', | ||
'1100110', | ||
'011111', | ||
'00111', | ||
'0000', | ||
'0001', | ||
'0010', | ||
'01000', | ||
'100000', | ||
'100001', | ||
'100010', | ||
'100011', | ||
'100100', | ||
'100101', | ||
'100110', | ||
'11101100', | ||
'11111111111111100', | ||
'100111', | ||
'111111111111101', | ||
'1111111101', | ||
'111111111111110', | ||
'1100111', | ||
'11101101', | ||
'11101110', | ||
'1101000', | ||
'11101111', | ||
'1101001', | ||
'1101010', | ||
'111110010', | ||
'11110000', | ||
'111110011', | ||
'111110100', | ||
'111110101', | ||
'1101011', | ||
'1101100', | ||
'11110001', | ||
'11110010', | ||
'111110110', | ||
'111110111', | ||
'1101101', | ||
'101000', | ||
'11110011', | ||
'111111000', | ||
'111111001', | ||
'11110100', | ||
'111111010', | ||
'111111011', | ||
'11111111100', | ||
'11111111111111111111011010', | ||
'11111111101', | ||
'11111111111101', | ||
'1101110', | ||
'111111111111111110', | ||
'01001', | ||
'1101111', | ||
'01010', | ||
'101001', | ||
'01011', | ||
'1110000', | ||
'101010', | ||
'101011', | ||
'01100', | ||
'11110101', | ||
'11110110', | ||
'101100', | ||
'101101', | ||
'101110', | ||
'01101', | ||
'101111', | ||
'111111100', | ||
'110000', | ||
'110001', | ||
'01110', | ||
'1110001', | ||
'1110010', | ||
'11111100', | ||
'1110011', | ||
'11111101', | ||
'1111111111011', | ||
'1111111111111110000', | ||
'1111111111100', | ||
'11111111111100', | ||
'100010', | ||
'111111111111101', | ||
'00011', | ||
'100011', | ||
'00100', | ||
'100100', | ||
'00101', | ||
'100101', | ||
'100110', | ||
'100111', | ||
'00110', | ||
'1110100', | ||
'1110101', | ||
'11110111', | ||
'11111111111111101', | ||
'111111111100', | ||
'11111111111111110', | ||
'111111111101', | ||
'11111111111111111111011011', | ||
'11111111111111111111011100', | ||
'11111111111111111111011101', | ||
'11111111111111111111011110', | ||
'11111111111111111111011111', | ||
'101000', | ||
'101001', | ||
'101010', | ||
'00111', | ||
'101011', | ||
'1110110', | ||
'101100', | ||
'01000', | ||
'01001', | ||
'101101', | ||
'1110111', | ||
'1111000', | ||
'1111001', | ||
'1111010', | ||
'1111011', | ||
'111111111111110', | ||
'11111111100', | ||
'11111111111101', | ||
'1111111111101', | ||
'1111111111111111111111111100', | ||
'11111111111111100110', | ||
'1111111111111111010010', | ||
'11111111111111100111', | ||
'11111111111111101000', | ||
'1111111111111111010011', | ||
'1111111111111111010100', | ||
'1111111111111111010101', | ||
'11111111111111111011001', | ||
'1111111111111111010110', | ||
'11111111111111111011010', | ||
'11111111111111111011011', | ||
'11111111111111111011100', | ||
'11111111111111111011101', | ||
'11111111111111111011110', | ||
'111111111111111111101011', | ||
'11111111111111111011111', | ||
'111111111111111111101100', | ||
'111111111111111111101101', | ||
'1111111111111111010111', | ||
'11111111111111111100000', | ||
'111111111111111111101110', | ||
'11111111111111111100001', | ||
'11111111111111111100010', | ||
'11111111111111111100011', | ||
'11111111111111111100100', | ||
'111111111111111011100', | ||
'1111111111111111011000', | ||
'11111111111111111100101', | ||
'1111111111111111011001', | ||
'11111111111111111100110', | ||
'11111111111111111100111', | ||
'111111111111111111101111', | ||
'1111111111111111011010', | ||
'111111111111111011101', | ||
'11111111111111101001', | ||
'1111111111111111011011', | ||
'1111111111111111011100', | ||
'11111111111111111101000', | ||
'11111111111111111101001', | ||
'111111111111111011110', | ||
'11111111111111111101010', | ||
'1111111111111111011101', | ||
'1111111111111111011110', | ||
'111111111111111111110000', | ||
'111111111111111011111', | ||
'1111111111111111011111', | ||
'11111111111111111101011', | ||
'11111111111111111101100', | ||
'111111111111111100000', | ||
'111111111111111100001', | ||
'1111111111111111100000', | ||
'111111111111111100010', | ||
'11111111111111111101101', | ||
'1111111111111111100001', | ||
'11111111111111111101110', | ||
'11111111111111111101111', | ||
'11111111111111101010', | ||
'1111111111111111100010', | ||
'1111111111111111100011', | ||
'1111111111111111100100', | ||
'11111111111111111110000', | ||
'1111111111111111100101', | ||
'1111111111111111100110', | ||
'11111111111111111110001', | ||
'11111111111111111111100000', | ||
'11111111111111111111100001', | ||
'11111111111111101011', | ||
'1111111111111110001', | ||
'1111111111111111100111', | ||
'11111111111111111110010', | ||
'1111111111111111101000', | ||
'1111111111111111111101100', | ||
'11111111111111111111100010', | ||
'11111111111111111111100011', | ||
'11111111111111111111100100', | ||
'111111111111111111111011110', | ||
'111111111111111111111011111', | ||
'11111111111111111111100101', | ||
'111111111111111111110001', | ||
'1111111111111111111101101', | ||
'1111111111111110010', | ||
'111111111111111100011', | ||
'11111111111111111111100110', | ||
'111111111111111111111100000', | ||
'111111111111111111111100001', | ||
'11111111111111111111100111', | ||
'111111111111111111111100010', | ||
'111111111111111111110010', | ||
'111111111111111100100', | ||
'111111111111111100101', | ||
'11111111111111111111101000', | ||
'11111111111111111111101001', | ||
'1111111111111111111111111101', | ||
'111111111111111111111100011', | ||
'111111111111111111111100100', | ||
'111111111111111111111100101', | ||
'11111111111111101100', | ||
'111111111111111111110011', | ||
'11111111111111101101', | ||
'111111111111111100110', | ||
'1111111111111111101001', | ||
'111111111111111100111', | ||
'111111111111111101000', | ||
'11111111111111111110011', | ||
'1111111111111111101010', | ||
'1111111111111111101011', | ||
'1111111111111111111101110', | ||
'1111111111111111111101111', | ||
'111111111111111111110100', | ||
'111111111111111111110101', | ||
'11111111111111111111101010', | ||
'11111111111111111110100', | ||
'11111111111111111111101011', | ||
'111111111111111111111100110', | ||
'11111111111111111111101100', | ||
'11111111111111111111101101', | ||
'111111111111111111111100111', | ||
'111111111111111111111101000', | ||
'111111111111111111111101001', | ||
'111111111111111111111101010', | ||
'111111111111111111111101011', | ||
'1111111111111111111111111110', | ||
'111111111111111111111101100', | ||
'111111111111111111111101101', | ||
'111111111111111111111101110', | ||
'111111111111111111111101111', | ||
'111111111111111111111110000', | ||
'11111111111111111111101110', | ||
'11111111111111111111101111', | ||
'11111111111111111111110000', | ||
'11111111111111111111110001', | ||
'11111111111111111111110010', | ||
'11111111111111111111110011', | ||
'11111111111111111111110100', | ||
'11111111111111111111110101', | ||
'11111111111111111111110110', | ||
'11111111111111111111110111', | ||
'11111111111111111111111000', | ||
'11111111111111111111111001', | ||
'11111111111111111111111010', | ||
'11111111111111111111111011', | ||
'11111111111111111111111100', | ||
'11111111111111111111111101', | ||
'11111111111111111111111110', | ||
'11111111111111111111111111', | ||
'1111111111111111110000000', | ||
'1111111111111111110000001', | ||
'1111111111111111110000010', | ||
'1111111111111111110000011', | ||
'1111111111111111110000100', | ||
'1111111111111111110000101', | ||
'1111111111111111110000110', | ||
'1111111111111111110000111', | ||
'1111111111111111110001000', | ||
'1111111111111111110001001', | ||
'1111111111111111110001010', | ||
'1111111111111111110001011', | ||
'1111111111111111110001100', | ||
'1111111111111111110001101', | ||
'1111111111111111110001110', | ||
'1111111111111111110001111', | ||
'1111111111111111110010000', | ||
'1111111111111111110010001', | ||
'1111111111111111110010010', | ||
'1111111111111111110010011', | ||
'1111111111111111110010100', | ||
'1111111111111111110010101', | ||
'1111111111111111110010110', | ||
'1111111111111111110010111', | ||
'1111111111111111110011000', | ||
'1111111111111111110011001', | ||
'1111111111111111110011010', | ||
'1111111111111111110011011', | ||
'1111111111111111110011100', | ||
'1111111111111111110011101', | ||
'1111111111111111110011110', | ||
'1111111111111111110011111', | ||
'1111111111111111110100000', | ||
'1111111111111111110100001', | ||
'1111111111111111110100010', | ||
'1111111111111111110100011', | ||
'1111111111111111110100100', | ||
'1111111111111111110100101', | ||
'1111111111111111110100110', | ||
'1111111111111111110100111', | ||
'1111111111111111110101000', | ||
'1111111111111111110101001', | ||
'1111111111111111110101010', | ||
'1111111111111111110101011', | ||
'1111111111111111110101100', | ||
'1111111111111111110101101', | ||
'1111111111111111110101110', | ||
'1111111111111111110101111', | ||
'1111111111111111110110000', | ||
'1111111111111111110110001', | ||
'1111111111111111110110010', | ||
'1111111111111111110110011', | ||
'1111111111111111110110100', | ||
'1111111111111111110110101', | ||
'1111111111111111110110110', | ||
'1111111111111111110110111', | ||
'1111111111111111110111000', | ||
'1111111111111111110111001', | ||
'1111111111111111110111010', | ||
'1111111111111111110111011', | ||
'1111111111111111110111100', | ||
'1111111111111111110111101', | ||
'1111111111111111110111110', | ||
'1111111111111111110111111', | ||
'1111111111111111111000000', | ||
'1111111111111111111000001', | ||
'1111111111111111111000010', | ||
'1111111111111111111000011', | ||
'1111111111111111111000100', | ||
'1111111111111111111000101', | ||
'1111111111111111111000110', | ||
'1111111111111111111000111', | ||
'1111111111111111111001000', | ||
'1111111111111111111001001', | ||
'1111111111111111111001010', | ||
'1111111111111111111001011', | ||
'1111111111111111111001100', | ||
'1111111111111111111001101', | ||
'1111111111111111111001110', | ||
'1111111111111111111001111', | ||
'1111111111111111111010000', | ||
'1111111111111111111010001', | ||
'1111111111111111111010010', | ||
'1111111111111111111010011', | ||
'1111111111111111111010100', | ||
'1111111111111111111010101', | ||
'1111111111111111111010110', | ||
'1111111111111111111010111', | ||
'1111111111111111111011000', | ||
'1111111111111111111011001', | ||
'1111111111111111111011010', | ||
'1111111111111111111011011', | ||
'1111111111111111111011100' | ||
'111111111111111111111111111111' | ||
]); | ||
@@ -971,0 +971,0 @@ |
@@ -22,3 +22,3 @@ var assert = require('assert'); | ||
// | ||
// [1]: http://tools.ietf.org/html/draft-ietf-httpbis-http2-12#section-6.9.2 | ||
// [1]: http://tools.ietf.org/html/draft-ietf-httpbis-http2-13#section-6.9.2 | ||
@@ -25,0 +25,0 @@ // API for child classes |
@@ -142,3 +142,3 @@ // The framer consists of two [Transform Stream][1] subclasses that operate in [object mode][2]: | ||
this._log.error('Unknown type incoming frame'); | ||
this.emit('error', 'PROTOCOL_ERROR'); | ||
// Ignore it other than logging | ||
} | ||
@@ -152,3 +152,3 @@ this._next(COMMON_HEADER_SIZE); | ||
// [Frame Header](http://tools.ietf.org/html/draft-ietf-httpbis-http2-12#section-4.1) | ||
// [Frame Header](http://tools.ietf.org/html/draft-ietf-httpbis-http2-13#section-4.1) | ||
// -------------------------------------------------------------- | ||
@@ -244,2 +244,6 @@ // | ||
frame.type = frameTypes[buffer.readUInt8(2)]; | ||
if (!frame.type) { | ||
// We are required to ignore unknown frame types | ||
return length; | ||
} | ||
@@ -268,3 +272,3 @@ frame.flags = {}; | ||
// [DATA Frames](http://tools.ietf.org/html/draft-ietf-httpbis-http2-12#section-6.1) | ||
// [DATA Frames](http://tools.ietf.org/html/draft-ietf-httpbis-http2-13#section-6.1) | ||
// ------------------------------------------------------------ | ||
@@ -284,14 +288,8 @@ // | ||
// forwarding frames. | ||
// * PAD_LOW (0x08): | ||
// Bit 4 being set indicates that the Pad Low field is present. | ||
// * PAD_HIGH (0x10): | ||
// Bit 5 being set indicates that the Pad High field is present. This bit MUST NOT be set unless | ||
// the PAD_LOW flag is also set. Endpoints that receive a frame with PAD_HIGH set and PAD_LOW | ||
// cleared MUST treat this as a connection error of type PROTOCOL_ERROR. | ||
// * COMPRESSED (0x20): | ||
// Bit 6 being set indicates that the data in the frame has been compressed with GZIP compression. | ||
// * PADDED (0x08): | ||
// Bit 4 being set indicates that the Pad Length field is present. | ||
frameTypes[0x0] = 'DATA'; | ||
frameFlags.DATA = ['END_STREAM', 'END_SEGMENT', 'RESERVED4', 'PAD_LOW', 'PAD_HIGH', 'COMPRESSED']; | ||
frameFlags.DATA = ['END_STREAM', 'END_SEGMENT', 'RESERVED4', 'PADDED']; | ||
@@ -307,17 +305,7 @@ typeSpecificAttributes.DATA = ['data']; | ||
var paddingLength = 0; | ||
if (frame.flags.PAD_LOW) { | ||
if (frame.flags.PAD_HIGH) { | ||
paddingLength = (buffer.readUInt8(dataOffset) & 0xff) * 256; | ||
dataOffset += 1; | ||
} | ||
paddingLength += (buffer.readUInt8(dataOffset) & 0xff); | ||
dataOffset += 1; | ||
} else if (frame.flags.PAD_HIGH) { | ||
return 'DATA frame got PAD_HIGH without PAD_LOW'; | ||
if (frame.flags.PADDED) { | ||
paddingLength = (buffer.readUInt8(dataOffset) & 0xff); | ||
dataOffset = 1; | ||
} | ||
if (frame.flags.COMPRESSED) { | ||
return 'DATA frame received COMPRESSED data (unsupported)'; | ||
} | ||
if (paddingLength) { | ||
@@ -330,3 +318,3 @@ frame.data = buffer.slice(dataOffset, -1 * paddingLength); | ||
// [HEADERS](http://tools.ietf.org/html/draft-ietf-httpbis-http2-12#section-6.2) | ||
// [HEADERS](http://tools.ietf.org/html/draft-ietf-httpbis-http2-13#section-6.2) | ||
// -------------------------------------------------------------- | ||
@@ -348,12 +336,11 @@ // | ||
// a complete set of headers. | ||
// * PAD_LOW (0x08): | ||
// Bit 5 being set indicates that the Pad Low field is present. | ||
// * PAD_HIGH (0x10): | ||
// Bit 6 being set indicates that the Pad High field is present. This bit MUST NOT be set unless | ||
// the PAD_LOW flag is also set. Endpoints that receive a frame with PAD_HIGH set and PAD_LOW | ||
// cleared MUST treat this as a connection error of type PROTOCOL_ERROR. | ||
// * PADDED (0x08): | ||
// Bit 4 being set indicates that the Pad Length field is present. | ||
// * PRIORITY (0x20): | ||
// Bit 6 being set indicates that the Exlusive Flag (E), Stream Dependency, and Weight fields are | ||
// present. | ||
frameTypes[0x1] = 'HEADERS'; | ||
frameFlags.HEADERS = ['END_STREAM', 'END_SEGMENT', 'END_HEADERS', 'PAD_LOW', 'PAD_HIGH', 'PRIORITY']; | ||
frameFlags.HEADERS = ['END_STREAM', 'END_SEGMENT', 'END_HEADERS', 'PADDED', 'RESERVED5', 'PRIORITY']; | ||
@@ -365,3 +352,3 @@ typeSpecificAttributes.HEADERS = ['priorityDependency', 'priorityWeight', 'exclusiveDependency', 'headers', 'data']; | ||
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
// | Pad High? (8) | Pad Low? (8) | | ||
// |Pad Length? (8)| | ||
// +-+-------------+---------------+-------------------------------+ | ||
@@ -397,11 +384,5 @@ // |E| Stream Dependency? (31) | | ||
var paddingLength = 0; | ||
if (frame.flags.PAD_LOW) { | ||
if (frame.flags.PAD_HIGH) { | ||
paddingLength = (buffer.readUInt8(dataOffset) & 0xff) * 256; | ||
dataOffset += 1; | ||
} | ||
paddingLength += (buffer.readUInt8(dataOffset) & 0xff); | ||
dataOffset += 1; | ||
} else if (frame.flags.PAD_HIGH) { | ||
return 'HEADERS frame got PAD_HIGH without PAD_LOW'; | ||
if (frame.flags.PADDED) { | ||
paddingLength = (buffer.readUInt8(dataOffset) & 0xff); | ||
dataOffset = 1; | ||
} | ||
@@ -427,3 +408,3 @@ | ||
// [PRIORITY](http://tools.ietf.org/html/draft-ietf-httpbis-http2-12#section-6.3) | ||
// [PRIORITY](http://tools.ietf.org/html/draft-ietf-httpbis-http2-13#section-6.3) | ||
// ------------------------------------------------------- | ||
@@ -473,3 +454,3 @@ // | ||
// [RST_STREAM](http://tools.ietf.org/html/draft-ietf-httpbis-http2-12#section-6.4) | ||
// [RST_STREAM](http://tools.ietf.org/html/draft-ietf-httpbis-http2-13#section-6.4) | ||
// ----------------------------------------------------------- | ||
@@ -506,5 +487,9 @@ // | ||
frame.error = errorCodes[buffer.readUInt32BE(0)]; | ||
if (!frame.error) { | ||
// Unknown error codes are considered equivalent to INTERNAL_ERROR | ||
frame.error = 'INTERNAL_ERROR'; | ||
} | ||
}; | ||
// [SETTINGS](http://tools.ietf.org/html/draft-ietf-httpbis-http2-12#section-6.5) | ||
// [SETTINGS](http://tools.ietf.org/html/draft-ietf-httpbis-http2-13#section-6.5) | ||
// ------------------------------------------------------- | ||
@@ -526,4 +511,4 @@ // | ||
// The payload of a SETTINGS frame consists of zero or more settings. Each setting consists of an | ||
// 8-bit identifier, and an unsigned 32-bit value. | ||
// The payload of a SETTINGS frame consists of zero or more settings. Each setting consists of a | ||
// 16-bit identifier, and an unsigned 32-bit value. | ||
// | ||
@@ -533,6 +518,6 @@ // 0 1 2 3 | ||
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
// | Identifier(8) | Value (32) | | ||
// | Identifier(16) | Value (32) | | ||
// +-----------------+---------------------------------------------+ | ||
// ...Value | | ||
// +-----------------+ | ||
// ...Value | | ||
// +---------------------------------+ | ||
// | ||
@@ -557,6 +542,6 @@ // Each setting in a SETTINGS frame replaces the existing value for that setting. Settings are | ||
var buffer = new Buffer(settings.length * 5); | ||
var buffer = new Buffer(settings.length * 6); | ||
for (var i = 0; i < settings.length; i++) { | ||
buffer.writeUInt8(settings[i].id & 0xff, i*5); | ||
buffer.writeUInt32BE(settings[i].value, i*5 + 1); | ||
buffer.writeUInt16BE(settings[i].id & 0xffff, i*6); | ||
buffer.writeUInt32BE(settings[i].value, i*6 + 2); | ||
} | ||
@@ -569,3 +554,3 @@ | ||
frame.settings = {}; | ||
// Receipt of a SETTINGS frame with the ACK flag set and a length | ||
@@ -578,7 +563,7 @@ // field value other than 0 MUST be treated as a connection error | ||
if (buffer.length % 5 !== 0) { | ||
if (buffer.length % 6 !== 0) { | ||
return 'PROTOCOL_ERROR'; | ||
} | ||
for (var i = 0; i < buffer.length / 5; i++) { | ||
var id = buffer.readUInt8(i*5) & 0xff; | ||
for (var i = 0; i < buffer.length / 6; i++) { | ||
var id = buffer.readUInt16BE(i*6) & 0xffff; | ||
var setting = definedSettings[id]; | ||
@@ -589,7 +574,4 @@ if (setting) { | ||
} | ||
var value = buffer.readUInt32BE(i*5 + 1); | ||
var value = buffer.readUInt32BE(i*6 + 2); | ||
frame.settings[setting.name] = setting.flag ? Boolean(value & 0x1) : value; | ||
} else { | ||
/* Unknown setting, protocol error */ | ||
return 'SETTINGS frame got unknown setting type'; | ||
} | ||
@@ -621,9 +603,3 @@ } | ||
// * SETTINGS_COMPRESS_DATA (5): | ||
// this setting is used to enable GZip compression of DATA frames. A value of 1 indicates that | ||
// DATA frames MAY be compressed. A value of 0 indicates that compression is not permitted. | ||
// The initial value is 0. | ||
definedSettings[5] = { name: 'SETTINGS_COMPRESS_DATA', flag: true }; | ||
// [PUSH_PROMISE](http://tools.ietf.org/html/draft-ietf-httpbis-http2-12#section-6.6) | ||
// [PUSH_PROMISE](http://tools.ietf.org/html/draft-ietf-httpbis-http2-13#section-6.6) | ||
// --------------------------------------------------------------- | ||
@@ -642,3 +618,3 @@ // | ||
frameFlags.PUSH_PROMISE = ['RESERVED1', 'RESERVED2', 'END_PUSH_PROMISE', 'PAD_LOW', 'PAD_HIGH']; | ||
frameFlags.PUSH_PROMISE = ['RESERVED1', 'RESERVED2', 'END_PUSH_PROMISE', 'PADDED']; | ||
@@ -650,6 +626,10 @@ typeSpecificAttributes.PUSH_PROMISE = ['promised_stream', 'headers', 'data']; | ||
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
// |Pad Length? (8)| | ||
// +-+-------------+-----------------------------------------------+ | ||
// |X| Promised-Stream-ID (31) | | ||
// +-+-------------------------------------------------------------+ | ||
// | Header Block (*) ... | ||
// | Header Block Fragment (*) ... | ||
// +---------------------------------------------------------------+ | ||
// | Padding (*) ... | ||
// +---------------------------------------------------------------+ | ||
// | ||
@@ -674,11 +654,5 @@ // The PUSH_PROMISE frame includes the unsigned 31-bit identifier of | ||
var paddingLength = 0; | ||
if (frame.flags.PAD_LOW) { | ||
if (frame.flags.PAD_HIGH) { | ||
paddingLength = (buffer.readUInt8(dataOffset) & 0xff) * 256; | ||
dataOffset += 1; | ||
} | ||
paddingLength += (buffer.readUInt8(dataOffset) & 0xff); | ||
dataOffset += 1; | ||
} else if (frame.flags.PAD_HIGH) { | ||
return 'PUSH_PROMISE frame got PAD_HIGH without PAD_LOW'; | ||
if (frame.flags.PADDED) { | ||
paddingLength = (buffer.readUInt8(dataOffset) & 0xff); | ||
dataOffset = 1; | ||
} | ||
@@ -694,3 +668,3 @@ frame.promised_stream = buffer.readUInt32BE(dataOffset) & 0x7fffffff; | ||
// [PING](http://tools.ietf.org/html/draft-ietf-httpbis-http2-12#section-6.7) | ||
// [PING](http://tools.ietf.org/html/draft-ietf-httpbis-http2-13#section-6.7) | ||
// ----------------------------------------------- | ||
@@ -725,3 +699,3 @@ // | ||
// [GOAWAY](http://tools.ietf.org/html/draft-ietf-httpbis-http2-12#section-6.8) | ||
// [GOAWAY](http://tools.ietf.org/html/draft-ietf-httpbis-http2-13#section-6.8) | ||
// --------------------------------------------------- | ||
@@ -771,5 +745,9 @@ // | ||
frame.error = errorCodes[buffer.readUInt32BE(4)]; | ||
if (!frame.error) { | ||
// Unknown error types are to be considered equivalent to INTERNAL ERROR | ||
frame.error = 'INTERNAL_ERROR'; | ||
} | ||
}; | ||
// [WINDOW_UPDATE](http://tools.ietf.org/html/draft-ietf-httpbis-http2-12#section-6.9) | ||
// [WINDOW_UPDATE](http://tools.ietf.org/html/draft-ietf-httpbis-http2-13#section-6.9) | ||
// ----------------------------------------------------------------- | ||
@@ -809,3 +787,3 @@ // | ||
// [CONTINUATION](http://tools.ietf.org/html/draft-ietf-httpbis-http2-12#section-6.10) | ||
// [CONTINUATION](http://tools.ietf.org/html/draft-ietf-httpbis-http2-13#section-6.10) | ||
// ------------------------------------------------------------ | ||
@@ -820,12 +798,6 @@ // | ||
// necessary to provide a complete set of headers. | ||
// * PAD_LOW (0x08): | ||
// Bit 5 being set indicates that the Pad Low field is present. | ||
// * PAD_HIGH (0x10): | ||
// Bit 6 being set indicates that the Pad High field is present. This bit MUST NOT be set unless | ||
// the PAD_LOW flag is also set. Endpoints that receive a frame with PAD_HIGH set and PAD_LOW | ||
// cleared MUST treat this as a connection error of type PROTOCOL_ERROR. | ||
frameTypes[0x9] = 'CONTINUATION'; | ||
frameFlags.CONTINUATION = ['RESERVED1', 'RESERVED2', 'END_HEADERS', 'PAD_LOW', 'PAD_HIGH']; | ||
frameFlags.CONTINUATION = ['RESERVED1', 'RESERVED2', 'END_HEADERS']; | ||
@@ -839,22 +811,6 @@ typeSpecificAttributes.CONTINUATION = ['headers', 'data']; | ||
Deserializer.CONTINUATION = function readContinuation(buffer, frame) { | ||
var dataOffset = 0; | ||
var paddingLength = 0; | ||
if (frame.flags.PAD_LOW) { | ||
if (frame.flags.PAD_HIGH) { | ||
paddingLength = (buffer.readUInt8(dataOffset) & 0xff) * 256; | ||
dataOffset += 1; | ||
} | ||
paddingLength += (buffer.readUInt8(dataOffset) & 0xff); | ||
dataOffset += 1; | ||
} else if (frame.flags.PAD_HIGH) { | ||
return 'CONTINUATION frame got PAD_HIGH without PAD_LOW'; | ||
} | ||
if (paddingLength) { | ||
frame.data = buffer.slice(dataOffset, -1 * paddingLength); | ||
} else { | ||
frame.data = buffer.slice(dataOffset); | ||
} | ||
frame.data = buffer; | ||
}; | ||
// [ALTSVC](http://tools.ietf.org/html/draft-ietf-httpbis-http2-12#section-6.11) | ||
// [ALTSVC](http://tools.ietf.org/html/draft-ietf-httpbis-http2-13#section-6.11) | ||
// ------------------------------------------------------------ | ||
@@ -948,3 +904,3 @@ // | ||
// [BLOCKED](http://tools.ietf.org/html/draft-ietf-httpbis-http2-12#section-6.12) | ||
// [BLOCKED](http://tools.ietf.org/html/draft-ietf-httpbis-http2-13#section-6.12) | ||
// ------------------------------------------------------------ | ||
@@ -969,3 +925,3 @@ // | ||
// [Error Codes](http://tools.ietf.org/html/draft-ietf-httpbis-http2-12#section-7) | ||
// [Error Codes](http://tools.ietf.org/html/draft-ietf-httpbis-http2-13#section-7) | ||
// ------------------------------------------------------------ | ||
@@ -972,0 +928,0 @@ |
@@ -1,2 +0,2 @@ | ||
// [node-http2-protocol][homepage] is an implementation of the [HTTP/2 (draft 12)][http2] | ||
// [node-http2-protocol][homepage] is an implementation of the [HTTP/2 (draft 13)][http2] | ||
// framing layer for [node.js][node]. | ||
@@ -31,6 +31,6 @@ // | ||
// [homepage]: https://github.com/molnarg/node-http2 | ||
// [http2]: http://tools.ietf.org/html/draft-ietf-httpbis-http2-12 | ||
// [http2-connheader]: http://tools.ietf.org/html/draft-ietf-httpbis-http2-12#section-3.5 | ||
// [http2-stream]: http://tools.ietf.org/html/draft-ietf-httpbis-http2-12#section-5 | ||
// [http2-streamstate]: http://tools.ietf.org/html/draft-ietf-httpbis-http2-12#section-5.1 | ||
// [http2]: http://tools.ietf.org/html/draft-ietf-httpbis-http2-13 | ||
// [http2-connheader]: http://tools.ietf.org/html/draft-ietf-httpbis-http2-13#section-3.5 | ||
// [http2-stream]: http://tools.ietf.org/html/draft-ietf-httpbis-http2-13#section-5 | ||
// [http2-streamstate]: http://tools.ietf.org/html/draft-ietf-httpbis-http2-13#section-5.1 | ||
// [node]: http://nodejs.org/ | ||
@@ -41,3 +41,3 @@ // [node-stream]: http://nodejs.org/api/stream.html | ||
exports.ImplementedVersion = 'h2-12'; | ||
exports.ImplementedVersion = 'h2-13'; | ||
@@ -44,0 +44,0 @@ exports.Endpoint = require('./endpoint').Endpoint; |
@@ -349,3 +349,3 @@ var assert = require('assert'); | ||
// [Stream States](http://tools.ietf.org/html/draft-ietf-httpbis-http2-12#section-5.1) | ||
// [Stream States](http://tools.ietf.org/html/draft-ietf-httpbis-http2-13#section-5.1) | ||
// ---------------- | ||
@@ -352,0 +352,0 @@ // |
{ | ||
"name": "http2-protocol", | ||
"version": "0.12.3", | ||
"version": "0.13.0", | ||
"description": "A JavaScript implementation of the HTTP/2 framing layer", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
node-http2-protocol | ||
=================== | ||
An HTTP/2 ([draft-ietf-httpbis-http2-12](http://tools.ietf.org/html/draft-ietf-httpbis-http2-12)) | ||
An HTTP/2 ([draft-ietf-httpbis-http2-13](http://tools.ietf.org/html/draft-ietf-httpbis-http2-13)) | ||
framing layer implementaion for node.js. | ||
@@ -53,8 +53,8 @@ | ||
To generate a code coverage report, run `npm test --coverage` (it may be slow, be patient). | ||
Code coverage summary as of version 0.12.3: | ||
Code coverage summary as of version 0.13.0: | ||
``` | ||
Statements : 91.55% ( 1355/1480 ) | ||
Branches : 85.43% ( 563/659 ) | ||
Statements : 92.23% ( 1341/1454 ) | ||
Branches : 86% ( 553/643 ) | ||
Functions : 91.93% ( 148/161 ) | ||
Lines : 91.64% ( 1349/1472 ) | ||
Lines : 92.32% ( 1335/1446 ) | ||
``` | ||
@@ -61,0 +61,0 @@ |
@@ -32,3 +32,3 @@ var expect = require('chai').expect; | ||
string: 'www.foo.com', | ||
buffer: new Buffer('89e7cf9bfc1ad7d4db7f', 'hex') | ||
buffer: new Buffer('89f1e3c2f29ceb90f4ff', 'hex') | ||
}, { | ||
@@ -40,23 +40,23 @@ string: 'éáűőúöüó€', | ||
test_huffman_request = { | ||
'GET': 'd5df47', | ||
'http': 'adcebf', | ||
'/': '3f', | ||
'www.foo.com': 'e7cf9bfc1ad7d4db7f', | ||
'https': 'adcebf1f', | ||
'www.bar.com': 'e7cf9bfbd383ea6dbf', | ||
'no-cache': 'b9b9949556bf', | ||
'/custom-path.css': '3ab8e2e6db9af4bab7d58e3f', | ||
'custom-key': '571c5cdb737b2faf', | ||
'custom-value': '571c5cdb73724d9c57' | ||
'GET': 'c5837f', | ||
'http': '9d29af', | ||
'/': '63', | ||
'www.foo.com': 'f1e3c2f29ceb90f4ff', | ||
'https': '9d29ad1f', | ||
'www.bar.com': 'f1e3c2f18ec5c87a7f', | ||
'no-cache': 'a8eb10649cbf', | ||
'/custom-path.css': '6096a127a56ac699d72211', | ||
'custom-key': '25a849e95ba97d7f', | ||
'custom-value': '25a849e95bb8e8b4bf' | ||
}; | ||
test_huffman_response = { | ||
'302': '4017', | ||
'private': 'bf06724b97', | ||
'Mon, 21 OCt 2013 20:13:21 GMT': 'd6dbb29884de3dce3100a0c4130a262136ad747f', | ||
': https://www.bar.com': '98d5b9d7e331cfcf9f37f7a707d4db7f', | ||
'200': '200f', | ||
'Mon, 21 OCt 2013 20:13:22 GMT': 'd6dbb29884de3dce3100a0c4130a262236ad747f', | ||
'https://www.bar.com': 'adcebf198e7e7cf9bfbd383ea6db', | ||
'gzip': 'abdd97ff', | ||
'302': '6402', | ||
'private': 'aec3771a4b', | ||
'Mon, 21 OCt 2013 20:13:21 GMT': 'd07abe941054d5792a0801654102e059b820a98b46ff', | ||
': https://www.bar.com': 'b8a4e94d68b8c31e3c785e31d8b90f4f', | ||
'200': '1001', | ||
'Mon, 21 OCt 2013 20:13:22 GMT': 'd07abe941054d5792a0801654102e059b821298b46ff', | ||
'https://www.bar.com': '9d29ad171863c78f0bc63b1721e9', | ||
'gzip': '9bd9ab', | ||
'foo=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\ | ||
@@ -69,3 +69,3 @@ AAAAAAAAAAAAAAAAAAAAAAAAAALASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEIUAL\ | ||
ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ1234 m\ | ||
ax-age=3600; version=1': 'e0d6cf9f3e7cf9f3e7cf9f3e7cf9f3e7cf9f3e7cf9f3e7cf9f3e7cf9f3e7cf9f3e7cf9f3e7cf9f3e7cf9f3e7cf9f3e7cf9f3e7cf9f3e7cf9f3e7cf9f3e7cf9f3e7cff5cfb747cfe9f2fb7d3b7f7e9e3f6fcf7f8f97879e7f4fb7e7bfc7c3cf3fa7d7e7f4f97dbf3e3dfe1e79febf6fcf7f8f879e7f4fafdbbfcf3fa7d7ebf4f9e7dba3edf9eff1f3f0cfe9b049107d73edd1f3fa7cbedf4edfdfa78fdbf3dfe3e5e1e79fd3edf9eff1f0f3cfe9f5f9fd3e5f6fcf8f7f879e7fafdbf3dfe3e1e79fd3ebf6eff3cfe9f5fafd3e79f6e8fb7e7bfc7cfc33fa6c12441f5cfb747cfe9f2fb7d3b7f7e9e3f6fcf7f8f97879e7f4fb7e7bfc7c3cf3fa7d7e7f4f97dbf3e3dfe1e79febf6fcf7f8f879e7f4fafdbbfcf3fa7d7ebf4f9e7dba3edf9eff1f3f0cfe9b049107d73edd1f3fa7cbedf4edfdfa78fdbf3dfe3e5e1e79fd3edf9eff1f0f3cfe9f5f9fd3e5f6fcf8f7f879e7fafdbf3dfe3e1e79fd3ebf6eff3cfe9f5fafd3e79f6e8fb7e7bfc7cfc33fa6c12441fbfdfeff7fbfdfeff7fbfdfeff7fbfdfeff7fbfdfeff7fbfdfeff7fbfdfeff7fbfdfeff7fbfdfeff7fbfdfeff7fbfdfeff7fbfdfeff7fbfdfeff7fbfdfeff7fbfdfeff7fbfdfeff7fbfdfeff7fbfdfeff624880d6a7a664d4b9d1100761b92f0c58dba71', | ||
ax-age=3600; version=1': '94e7821861861861861861861861861861861861861861861861861861861861861861861861861861861861861861861861861861861861873c3bafe5cd8f666bbfbf9ab672c1ab5e4e10fe6ce583564e10fe67cb9b1ece5ab064e10e7d9cb06ac9c21fccfb307087f33e7cd961dd7f672c1ab86487f34844cb59e1dd7f2e6c7b335dfdfcd5b3960d5af27087f3672c1ab27087f33e5cd8f672d583270873ece583564e10fe67d983843f99f3e6cb0eebfb3960d5c3243f9a42265acf0eebf97363d99aefefe6ad9cb06ad793843f9b3960d593843f99f2e6c7b396ac1938439f672c1ab27087f33ecc1c21fccf9f3658775fd9cb06ae1921fcd21132d678775fcb9b1eccd77f7f356ce58356bc9c21fcd9cb06ac9c21fccf97363d9cb560c9c21cfb3960d593843f99f660e10fe67cf9b2c3bafece583570c90fe6908996bf7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f42265a5291f9587316065c003ed4ee5b1063d5007f', | ||
'foo=ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ\ | ||
@@ -78,3 +78,3 @@ ZZZZZZZZZZZZZZZZZZZZZZZZZZLASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEIUAL\ | ||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA1234 m\ | ||
ax-age=3600; version=1': 'e0d6cffbfdfeff7fbfdfeff7fbfdfeff7fbfdfeff7fbfdfeff7fbfdfeff7fbfdfeff7fbfdfeff7fbfdfeff7fbfdfeff7fbfdfeff7fbfdfeff7fbfdfeff7fbfdfeff7fbfdfeff7fbfdfeff7fbfdfeff7fbfdfeff7f5cfb747cfe9f2fb7d3b7f7e9e3f6fcf7f8f97879e7f4fb7e7bfc7c3cf3fa7d7e7f4f97dbf3e3dfe1e79febf6fcf7f8f879e7f4fafdbbfcf3fa7d7ebf4f9e7dba3edf9eff1f3f0cfe9b049107d73edd1f3fa7cbedf4edfdfa78fdbf3dfe3e5e1e79fd3edf9eff1f0f3cfe9f5f9fd3e5f6fcf8f7f879e7fafdbf3dfe3e1e79fd3ebf6eff3cfe9f5fafd3e79f6e8fb7e7bfc7cfc33fa6c12441f5cfb747cfe9f2fb7d3b7f7e9e3f6fcf7f8f97879e7f4fb7e7bfc7c3cf3fa7d7e7f4f97dbf3e3dfe1e79febf6fcf7f8f879e7f4fafdbbfcf3fa7d7ebf4f9e7dba3edf9eff1f3f0cfe9b049107d73edd1f3fa7cbedf4edfdfa78fdbf3dfe3e5e1e79fd3edf9eff1f0f3cfe9f5f9fd3e5f6fcf8f7f879e7fafdbf3dfe3e1e79fd3ebf6eff3cfe9f5fafd3e79f6e8fb7e7bfc7cfc33fa6c124419f3e7cf9f3e7cf9f3e7cf9f3e7cf9f3e7cf9f3e7cf9f3e7cf9f3e7cf9f3e7cf9f3e7cf9f3e7cf9f3e7cf9f3e7cf9f3e7cf9f3e7cf9f3e7cf9f3e7cf9f3e7ce24880d6a7a664d4b9d1100761b92f0c58dba71' | ||
ax-age=3600; version=1': '94e783f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f73c3bafe5cd8f666bbfbf9ab672c1ab5e4e10fe6ce583564e10fe67cb9b1ece5ab064e10e7d9cb06ac9c21fccfb307087f33e7cd961dd7f672c1ab86487f34844cb59e1dd7f2e6c7b335dfdfcd5b3960d5af27087f3672c1ab27087f33e5cd8f672d583270873ece583564e10fe67d983843f99f3e6cb0eebfb3960d5c3243f9a42265acf0eebf97363d99aefefe6ad9cb06ad793843f9b3960d593843f99f2e6c7b396ac1938439f672c1ab27087f33ecc1c21fccf9f3658775fd9cb06ae1921fcd21132d678775fcb9b1eccd77f7f356ce58356bc9c21fcd9cb06ac9c21fccf97363d9cb560c9c21cfb3960d593843f99f660e10fe67cf9b2c3bafece583570c90fe6908996a1861861861861861861861861861861861861861861861861861861861861861861861861861861861861861861861861861861861842265a5291f9587316065c003ed4ee5b1063d5007f' | ||
}; | ||
@@ -105,3 +105,3 @@ | ||
}, | ||
buffer: new Buffer('47' + '83ADCEBF', 'hex') | ||
buffer: new Buffer('47' + '839d29af', 'hex') | ||
}, { | ||
@@ -130,3 +130,3 @@ // literal w/index, name index | ||
}, | ||
buffer: new Buffer('44' + '89E7CF9BFC1AD7D4DB7F', 'hex') | ||
buffer: new Buffer('44' + '89f1e3c2f29ceb90f4ff', 'hex') | ||
}, { | ||
@@ -143,3 +143,3 @@ // literal w/index, name index | ||
}, | ||
buffer: new Buffer('43' + '84ADCEBF1F', 'hex') | ||
buffer: new Buffer('43' + '849d29ad1f', 'hex') | ||
}, { | ||
@@ -156,3 +156,3 @@ // literal w/index, name index | ||
}, | ||
buffer: new Buffer('42' + '89E7CF9BFBD383EA6DBF', 'hex') | ||
buffer: new Buffer('42' + '89f1e3c2f18ec5c87a7f', 'hex') | ||
}, { | ||
@@ -169,3 +169,3 @@ // literal w/index, name index | ||
}, | ||
buffer: new Buffer('5e' + '86B9B9949556BF', 'hex') | ||
buffer: new Buffer('5e' + '86a8eb10649cbf', 'hex') | ||
}, { | ||
@@ -206,3 +206,3 @@ // indexed | ||
}, | ||
buffer: new Buffer('45' + '8C3AB8E2E6DB9AF4BAB7D58E3F', 'hex') | ||
buffer: new Buffer('45' + '8b6096a127a56ac699d72211', 'hex') | ||
}, { | ||
@@ -219,3 +219,3 @@ // literal w/index, new name & value | ||
}, | ||
buffer: new Buffer('40' + '88571C5CDB737B2FAF' + '89571C5CDB73724D9C57', 'hex') | ||
buffer: new Buffer('40' + '8825a849e95ba97d7f' + '8925a849e95bb8e8b4bf', 'hex') | ||
}, { | ||
@@ -256,3 +256,3 @@ // indexed | ||
}, | ||
buffer: new Buffer('07' + '86E75A5CBE4BC3', 'hex') | ||
buffer: new Buffer('07' + '86f138d25ee5b3', 'hex') | ||
}, { | ||
@@ -269,3 +269,3 @@ // Literal w/o index, new name & value | ||
}, | ||
buffer: new Buffer('00' + '03666F6F' + '03626172', 'hex') | ||
buffer: new Buffer('00' + '8294e7' + '03626172', 'hex') | ||
}, { | ||
@@ -282,3 +282,3 @@ // Literal never indexed, name index | ||
}, | ||
buffer: new Buffer('17' + '86E75A5CBE4BC3', 'hex') | ||
buffer: new Buffer('17' + '86f138d25ee5b3', 'hex') | ||
}, { | ||
@@ -295,3 +295,3 @@ // Literal never indexed, new name & value | ||
}, | ||
buffer: new Buffer('10' + '03666F6F' + '03626172', 'hex') | ||
buffer: new Buffer('10' + '8294e7' + '03626172', 'hex') | ||
}, { | ||
@@ -298,0 +298,0 @@ header: { |
@@ -25,3 +25,3 @@ var expect = require('chai').expect; | ||
flags: { END_STREAM: false, END_SEGMENT: false, RESERVED4: false, | ||
PAD_LOW: false, PAD_HIGH: false, COMPRESSED: false }, | ||
PADDED: false }, | ||
stream: 10, | ||
@@ -38,3 +38,3 @@ | ||
flags: { END_STREAM: false, END_SEGMENT: false, END_HEADERS: false, | ||
PAD_LOW: false, PAD_HIGH: false, PRIORITY: false }, | ||
PADDED: false, RESERVED5: false, PRIORITY: false }, | ||
stream: 15, | ||
@@ -50,3 +50,3 @@ | ||
flags: { END_STREAM: false, END_SEGMENT: false, END_HEADERS: false, | ||
PAD_LOW: false, PAD_HIGH: false, PRIORITY: true }, | ||
PADDED: false, RESERVED5: false, PRIORITY: true }, | ||
stream: 15, | ||
@@ -66,3 +66,3 @@ priorityDependency: 10, | ||
flags: { END_STREAM: false, END_SEGMENT: false, END_HEADERS: false, | ||
PAD_LOW: false, PAD_HIGH: false, PRIORITY: true }, | ||
PADDED: false, RESERVED5: false, PRIORITY: true }, | ||
stream: 15, | ||
@@ -121,11 +121,9 @@ priorityDependency: 10, | ||
SETTINGS_MAX_CONCURRENT_STREAMS: 0x01234567, | ||
SETTINGS_INITIAL_WINDOW_SIZE: 0x89ABCDEF, | ||
SETTINGS_COMPRESS_DATA: true | ||
SETTINGS_INITIAL_WINDOW_SIZE: 0x89ABCDEF | ||
} | ||
}, | ||
buffer: new Buffer('0019' + '04' + '00' + '0000000A' + '01' + '12345678' + | ||
'02' + '00000001' + | ||
'03' + '01234567' + | ||
'04' + '89ABCDEF' + | ||
'05' + '00000001', 'hex') | ||
buffer: new Buffer('0018' + '04' + '00' + '0000000A' + '0001' + '12345678' + | ||
'0002' + '00000001' + | ||
'0003' + '01234567' + | ||
'0004' + '89ABCDEF', 'hex') | ||
@@ -136,3 +134,3 @@ }, { | ||
flags: { RESERVED1: false, RESERVED2: false, END_PUSH_PROMISE: false, | ||
PAD_LOW: false, PAD_HIGH: false }, | ||
PADDED: false }, | ||
stream: 15, | ||
@@ -178,4 +176,3 @@ | ||
type: 'CONTINUATION', | ||
flags: { RESERVED1: false, RESERVED2: false, END_HEADERS: true, | ||
PAD_LOW: false, PAD_HIGH: false }, | ||
flags: { RESERVED1: false, RESERVED2: false, END_HEADERS: true }, | ||
stream: 10, | ||
@@ -228,7 +225,7 @@ | ||
flags: { END_STREAM: false, END_SEGMENT: false, RESERVED4: false, | ||
PAD_LOW: true, PAD_HIGH: false, COMPRESSED: false }, | ||
PADDED: true }, | ||
stream: 10, | ||
data: new Buffer('12345678', 'hex') | ||
}, | ||
// length + type + flags + stream + pad_low control + content + padding | ||
// length + type + flags + stream + pad length + content + padding | ||
buffer: new Buffer('000B' + '00' + '08' + '0000000A' + '06' + '12345678' + '000000000000', 'hex') | ||
@@ -240,3 +237,3 @@ | ||
flags: { END_STREAM: false, END_SEGMENT: false, END_HEADERS: false, | ||
PAD_LOW: true, PAD_HIGH: false, PRIORITY: false }, | ||
PADDED: true, RESERVED5: false, PRIORITY: false }, | ||
stream: 15, | ||
@@ -246,3 +243,3 @@ | ||
}, | ||
// length + type + flags + stream + pad_low control + data + padding | ||
// length + type + flags + stream + pad length + data + padding | ||
buffer: new Buffer('000B' + '01' + '08' + '0000000F' + '06' + '12345678' + '000000000000', 'hex') | ||
@@ -254,3 +251,3 @@ | ||
flags: { END_STREAM: false, END_SEGMENT: false, END_HEADERS: false, | ||
PAD_LOW: true, PAD_HIGH: false, PRIORITY: true }, | ||
PADDED: true, RESERVED5: false, PRIORITY: true }, | ||
stream: 15, | ||
@@ -263,3 +260,3 @@ priorityDependency: 10, | ||
}, | ||
// length + type + flags + stream + pad_low control + priority dependency + priority weight + data + padding | ||
// length + type + flags + stream + pad length + priority dependency + priority weight + data + padding | ||
buffer: new Buffer('0010' + '01' + '28' + '0000000F' + '06' + '0000000A' + '05' + '12345678' + '000000000000', 'hex') | ||
@@ -271,3 +268,3 @@ | ||
flags: { END_STREAM: false, END_SEGMENT: false, END_HEADERS: false, | ||
PAD_LOW: true, PAD_HIGH: false, PRIORITY: true }, | ||
PADDED: true, RESERVED5: false, PRIORITY: true }, | ||
stream: 15, | ||
@@ -280,3 +277,3 @@ priorityDependency: 10, | ||
}, | ||
// length + type + flags + stream + pad_low control + priority dependency + priority weight + data + padding | ||
// length + type + flags + stream + pad length + priority dependency + priority weight + data + padding | ||
buffer: new Buffer('0010' + '01' + '28' + '0000000F' + '06' + '8000000A' + '05' + '12345678' + '000000000000', 'hex') | ||
@@ -286,16 +283,5 @@ | ||
frame: { | ||
type: 'CONTINUATION', | ||
flags: { RESERVED1: false, RESERVED2: false, END_HEADERS: true, | ||
PAD_LOW: true, PAD_HIGH: false }, | ||
stream: 10, | ||
data: new Buffer('12345678', 'hex') | ||
}, | ||
// length + type + flags + stream + pad_low control + data + padding | ||
buffer: new Buffer('000B' + '09' + '0C' + '0000000A' + '06' + '12345678' + '000000000000', 'hex') | ||
}, { | ||
frame: { | ||
type: 'PUSH_PROMISE', | ||
flags: { RESERVED1: false, RESERVED2: false, END_PUSH_PROMISE: false, | ||
PAD_LOW: true, PAD_HIGH: false }, | ||
PADDED: true }, | ||
stream: 15, | ||
@@ -306,3 +292,3 @@ | ||
}, | ||
// length + type + flags + stream + pad_low control + promised stream + data + padding | ||
// length + type + flags + stream + pad length + promised stream + data + padding | ||
buffer: new Buffer('000F' + '05' + '08' + '0000000F' + '06' + '00000003' + '12345678' + '000000000000', 'hex') | ||
@@ -309,0 +295,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
244824
5729