Buggy code:
public AJP12RequestAdapter ( ) { } public void setContextManager ( ContextManager cm ) { } public void setSocket ( Socket s ) throws IOException { } public AJP12RequestAdapter ( ContextManager cm , Socket s ) throws IOException { } protected void readNextRequest ( ) throws IOException { String dummy ; String token1 ; String token2 ; int marker ; int signal ; try { boolean more = true ; while ( more ) { marker = ajpin . read ( ) ; switch ( marker ) { case 0 : break ; case 1 : method = readString ( ajpin , null ) ; contextPath = readString ( ajpin , null ) ; if ( "ROOT" . equalsIgnoreCase ( contextPath ) ) contextPath = null ; if ( doLog ) d ( ( "AJP:<seq2seq4repair_space>CP=" + ( contextPath ) ) ) ; if ( ( contextPath ) != null ) context = contextM . getContext ( contextPath ) ; if ( doLog ) d ( ( "AJP:<seq2seq4repair_space>context=" + ( context ) ) ) ; servletName = readString ( ajpin , null ) ; if ( doLog ) d ( ( "AJP:<seq2seq4repair_space>servlet=" + ( servletName ) ) ) ; serverName = readString ( ajpin , null ) ; if ( doLog ) d ( ( "AJP:<seq2seq4repair_space>serverName=" + ( serverName ) ) ) ; dummy = readString ( ajpin , null ) ; pathInfo = readString ( ajpin , null ) ; if ( doLog ) d ( ( "AJP:<seq2seq4repair_space>PI=" + ( pathInfo ) ) ) ; pathTranslated = readString ( ajpin , null ) ; if ( doLog ) d ( ( "AJP:<seq2seq4repair_space>PT=" + ( pathTranslated ) ) ) ; queryString = readString ( ajpin , null ) ; if ( doLog ) d ( ( "AJP:<seq2seq4repair_space>QS=" + ( queryString ) ) ) ; remoteAddr = readString ( ajpin , "" ) ; if ( doLog ) d ( ( "AJP:<seq2seq4repair_space>RA=" + ( remoteAddr ) ) ) ; remoteHost = readString ( ajpin , "" ) ; if ( doLog ) d ( ( "AJP:<seq2seq4repair_space>RH=" + ( remoteHost ) ) ) ; remoteUser = readString ( ajpin , null ) ; if ( doLog ) d ( ( "AJP:<seq2seq4repair_space>RU=" + ( remoteUser ) ) ) ; authType = readString ( ajpin , null ) ; if ( doLog ) d ( ( "AJP:<seq2seq4repair_space>AT=" + ( authType ) ) ) ; dummy = readString ( ajpin , null ) ; method = readString ( ajpin , null ) ; if ( doLog ) d ( ( "AJP:<seq2seq4repair_space>Meth=" + ( method ) ) ) ; requestURI = readString ( ajpin , "" ) ; if ( doLog ) d ( ( ( ( ( ( "AJP:<seq2seq4repair_space>URI:<seq2seq4repair_space>" + ( requestURI ) ) + "<seq2seq4repair_space>CP:" ) + ( contextPath ) ) + "<seq2seq4repair_space>LP:<seq2seq4repair_space>" ) + ( lookupPath ) ) ) ; if ( doLog ) d ( ( ( ( ( ( "AJP:<seq2seq4repair_space>URI:<seq2seq4repair_space>" + ( requestURI ) ) + "<seq2seq4repair_space>CP:" ) + ( contextPath ) ) + "<seq2seq4repair_space>LP:<seq2seq4repair_space>" ) + ( lookupPath ) ) ) ; dummy = readString ( ajpin , null ) ; dummy = readString ( ajpin , null ) ; serverName = readString ( ajpin , "" ) ; if ( doLog ) d ( ( "AJP:<seq2seq4repair_space>serverName=" + ( serverName ) ) ) ; try { serverPort = Integer . parseInt ( readString ( ajpin , "80" ) ) ; } catch ( Exception any ) { serverPort = 80 ; } dummy = readString ( ajpin , "" ) ; dummy = readString ( ajpin , "" ) ; dummy = readString ( ajpin , "" ) ; jvmRoute = readString ( ajpin , "" ) ; if ( ( jvmRoute . length ( ) ) == 0 ) { jvmRoute = null ; } if ( doLog ) d ( ( "AJP:<seq2seq4repair_space>Server<seq2seq4repair_space>jvmRoute=" + ( jvmRoute ) ) ) ; dummy = readString ( ajpin , "" ) ; dummy = readString ( ajpin , "" ) ; break ; case 5 : token1 = readString ( ajpin , null ) ; token2 = readString ( ajpin , "" ) ; attributes . put ( token1 , token2 ) ; if ( ( token1 . equals ( "HTTPS" ) ) && ( token2 . equals ( "on" ) ) ) { setScheme ( "https" ) ; } break ; case 3 : token1 = readString ( ajpin , null ) ; token2 = readString ( ajpin , "" ) ; <START_BUG> headers . putHeader ( token1 . toLowerCase ( ) , token2 ) ; <END_BUG> break ; case 254 : signal = ajpin . read ( ) ; if ( signal == 0 ) { try { socket . getOutputStream ( ) . write ( 0 ) ; sin . close ( ) ; } catch ( IOException ignored ) { contextM . log ( "Exception<seq2seq4repair_space>closing,<seq2seq4repair_space>ignored" , ignored ) ; } isPing = true ; return ; } else { try { InetAddress serverAddr = socket . getLocalAddress ( ) ; InetAddress clientAddr = socket . getInetAddress ( ) ; sin . close ( ) ; if ( ( signal == 15 ) && ( isSameAddress ( serverAddr , clientAddr ) ) ) { contextM . stop ( ) ; System . exit ( 0 ) ; shutdown = true ; return ; } } catch ( Exception ignored ) { contextM . log ( ( "Ignored<seq2seq4repair_space>exception<seq2seq4repair_space>processing<seq2seq4repair_space>signal<seq2seq4repair_space>" + signal ) , ignored ) ; } } return ; case 4 : case 255 : more = false ; break ; case - 1 : throw new IOException ( "Stream<seq2seq4repair_space>closed<seq2seq4repair_space>prematurely" ) ; default : throw new IOException ( "Stream<seq2seq4repair_space>broken" ) ; } } } catch ( IOException ioe ) { throw ioe ; } catch ( Exception e ) { contextM . log ( "Uncaught<seq2seq4repair_space>exception<seq2seq4repair_space>handling<seq2seq4repair_space>request" , e ) ; } int indexQ = requestURI . indexOf ( "?" ) ;

Fix:
headers . addHeader ( token1 . toLowerCase ( ) , token2 ) ;