private void processRequestHeaderOverrides ( HttpMethod httpMethodProxyRequest ) throws Exception { RequestInformation requestInfo = requestInformation . get ( ) ; for ( EndpointOverride selectedPath : requestInfo . selectedRequestPaths ) { List < EnabledEndpoint > points = selectedPath . getEnabledEndpoints ( ) ; for ( EnabledEndpoint endpoint : points ) { if ( endpoint . getOverrideId ( ) == Constants . PLUGIN_REQUEST_HEADER_OVERRIDE_ADD ) { httpMethodProxyRequest . addRequestHeader ( endpoint . getArguments ( ) [ 0 ] . toString ( ) , endpoint . getArguments ( ) [ 1 ] . toString ( ) ) ; requestInfo . modified = true ; } else if ( endpoint . getOverrideId ( ) == Constants . PLUGIN_REQUEST_HEADER_OVERRIDE_REMOVE ) { httpMethodProxyRequest . removeRequestHeader ( endpoint . getArguments ( ) [ 0 ] . toString ( ) ) ; requestInfo . modified = true ; } } } }
Apply any applicable header overrides to request