Hi,
I am using the atscppapi and I am noticing something weird. When I
send a curl request, here's list of headers curl prints.

------------------------------------------------------------
> GET / HTTP/1.1
> Host: testhost1
> User-Agent: curl/7.47.0
> content-type: woof
> accept-encoding: gzip, deflate
> accept-language: en-ca
> accept: application/json, text/plain, */*
---------------------------------------------------------------

I have the following code to print the headers in my module.

---------------------------------------------------------------------------------
  ClientRequest &request = transaction.getClientRequest();
  Headers &headers = request.getHeaders();

  for (Headers::iterator hdr_itr = headers.begin(); hdr_itr !=
headers.end(); ++hdr_itr) {
    log.logInfo("%s:%s", (*hdr_itr).name().c_str(),
(*hdr_itr).values().c_str());
  }
------------------------------------------------------------------------------------

Here's what gets printed in the log:
------------------------------------------------------------------------------------
0191209.22h18m52s [INFO] Host:testhost1
20191209.22h18m52s [INFO] User-Agent:curl/7.47.0
20191209.22h18m52s [INFO] Content-Type:woof
20191209.22h18m52s [INFO] Accept-Encoding:gzip,deflate
20191209.22h18m52s [INFO] Accept-Language:en-ca
20191209.22h18m52s [INFO] Accept:application/json,text/plain,*/*
------------------------------------------------------------------------------------------

Notice the spaces are stripped off from all header values. I observed
that the server (origin) receives headers with the spaces being
stripped. Is this behavior specific to atscppapi? Is there a way to
prevent this from happening?

When I captured tcpdump, the incoming request has the spaces. Any help
is appreciated. Thanks.

Dk.

Reply via email to