@ Override public WsByteBuffer [ ] encodePseudoHeaders ( ) { WsByteBuffer [ ] firstLine = new WsByteBuffer [ 1 ] ; firstLine [ 0 ] = allocateBuffer ( getOutgoingBufferSize ( ) ) ; LiteralIndexType indexType = LiteralIndexType . NOINDEXING ; //For the time being, there will be no indexing on the responses to guarantee //the write context is concurrent to the remote endpoint's read context. Remote //intermediaries could index if they so desire, so setting NoIndexing (as //opposed to NeverIndexing). //TODO: investigate how streams and priority can work together with indexing on //responses. //LiteralIndexType indexType = isPushPromise ? LiteralIndexType.NOINDEXING : LiteralIndexType.INDEX; //Corresponding dynamic table H2HeaderTable table = this . getH2HeaderTable ( ) ; //Current encoded pseudo-header byte [ ] encodedHeader = null ; try { //Encode the Method encodedHeader = H2Headers . encodeHeader ( table , HpackConstants . METHOD , this . myMethod . toString ( ) , indexType ) ; firstLine = putBytes ( encodedHeader , firstLine ) ; //Encode Scheme encodedHeader = H2Headers . encodeHeader ( table , HpackConstants . SCHEME , this . myScheme . toString ( ) , indexType ) ; this . myScheme . toString ( ) ; firstLine = putBytes ( encodedHeader , firstLine ) ; //Encode Authority if ( this . sUrlHost != null ) { // TODO: should the iUrlPort be added here? encodedHeader = H2Headers . encodeHeader ( table , HpackConstants . AUTHORITY , this . sUrlHost , indexType ) ; firstLine = putBytes ( encodedHeader , firstLine ) ; } //Encode Path encodedHeader = H2Headers . encodeHeader ( table , HpackConstants . PATH , this . myURIString , indexType ) ; firstLine = putBytes ( encodedHeader , firstLine ) ; } catch ( Exception e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . error ( tc , e . getMessage ( ) ) ; } return null ; } // don't flip the last buffer as headers get tacked on the end if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { String url = GenericUtils . nullOutPasswords ( getMarshalledSecondToken ( ) , ( byte ) ' ' ) ; Tr . event ( tc , "Encoding first line: " + getMethod ( ) + " " + url + " " + getVersion ( ) ) ; } return firstLine ; }
of the first line .