Skip to content

Commit

Permalink
W-13680300: get target from request body
Browse files Browse the repository at this point in the history
  • Loading branch information
pmoineausf committed Jul 13, 2023
1 parent 28557d3 commit 5d03b25
Showing 1 changed file with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/
package com.demandware.carbonj.service.engine;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
Expand Down Expand Up @@ -101,8 +102,23 @@ else if ( protobuf )
{
LOG.info( "carbonapi request: found protobuf request" );
res.setContentType( "application/protobuf" );
//target = req.getParameter( "query" );
LOG.info( "carbonapi request: query: " + target + " --- blacklist: " + queryBlacklist );
// target = req.getParameter( "query" );
LOG.info( "carbonapi request: target from param: " + target + " --- blacklist: " + queryBlacklist );

if ( target == null )
{
LOG.info( "Target param not set. Reading from request body..." );
StringBuilder sb = new StringBuilder();
BufferedReader reader = req.getReader();
String line;
while ( ( line = reader.readLine() ) != null )
{
sb.append( line );
}
String requestBody = sb.toString();
target = requestBody;
}
LOG.info( "carbonapi request: targe from body: " + target + " --- blacklist: " + queryBlacklist );
}
else
{
Expand Down

0 comments on commit 5d03b25

Please sign in to comment.