Response Header value Truncates after a particular length

Not applicable

When I try to retrieve the response header (via java script or assign message)value it truncates at some length , for e.g my header is as below

Set-Cookie HPPSESSION=9shWQjwZ0jRPIN1T2NrnQYwLmgm4jZNCMCf8jVxREK4BDb+AMG8BwCztjMC5kbwSnWaNDadE70GdTGG2wMXnkEpxX60ZVKov5f+yLlj9htxdn3V5fm8ESGFG/n2QhZwnH+AP4jwlsKA4tCwVNpf7fZsdfPj+6Fmpp1dF71+E1mEQgHVxFh/JO0HlOvw2HedoeW7bV7rWW6SMteZ5cLGDfon6ik4YA9U7zJ0lQdYmtMFVTOHk+7INWlAhMJRX0TRWxxSZwz9HJvc4z3X4SEfYxAtILHDLQRCIQghdoi5RP8TFykBPfkPoWhmRMASo2skF2cWhTfpOQyeppd1gkyG17ViQI0ik9cyqfXmkOT1fl2QTi+bz6RNRa1Vyq4L82wqSume3Ny1BBq8EeSTRUsMLIa5fUHmGgVQfRMLwnPJ3XWKlbEz6a2bILszS7+FdaQLBHgPG1w7I2DC5tX07sS4495RHgs8wuIqoBtzzmpyW36B7p0QRg7ARCGX+qwJUt24Sp+NJty0exCrJ7xabxhHEzpeUyEVu2i+E3zpwgor/h8ouAhhD2l9PGNM4F0UOGFtiwzhqcmZoXC7tchoelfQKDs5QZw4EPodX2emWqGSSeNtVQjbo7fOj1RQu8U/KCorO9R2AYw1pExwwTb0UzZycvkS3vtCUhHqIarmnBOp9EUs8+az8lX3X653ie413lWAV/TdxeZ7d6yoM83XqZ+yHfWR3ElWZZO7QcpkrlF/kojS9pOlmwnPn0QnP5XW7wtMntgR54o6kndsHSGiQA0tYdN7NYvXcQ9akBoDuMN4mszdHMEkXFvTdqHPvrLwvuWxMmMzsbxhqvkNYYM+lRJ4h38b1qNU9icsl2VY9RBdYRznWP4k4NE5A1hZ8JtWQB6qcl7/La4VUEBw=; domain=.hp.com; expires=Thu,23-Jun-2016 00:20:00 GMT; path=/; secure

When I retrieve the value to a variable it truncates , please look at expire towards the end

HPPSESSION=p29WDuxRrcGayiqDej6eD7733O+8ECvh3ZxbUoZr0IOkoNUEV1lU+0bNLztqF0gQ9xVzEXNhcUCKqz/2JhKi53WS/25hVDQl67Px4fp1P98wbnJpOfF2kdAHuZrhENU2pxiI5VH2NalKaZ4SQBkB9cb4glFniwsY05FAQIIOul2ogKSS/hIud/jPVkxbHGtoe8PhVZ+sXX2MLKQgrIQR5fyYG57FU5ak/67W2ZxBk48/7/yTAjYk4QX1DNekcdY3fNGAVkactQXsTdu8kuPQ1BSJfc1gTqAyam/+bsKrMSixGCgsylEeHnlid0Jq+r9xnUU3rikoxGSJWfr/P8QhJWGZnD236LzApZZBADuFEQ12fW7na7r1vPhy43v9tWmdxhb2PpZZiFiDBQ2LZB0LyPgJcv1R+0b/zWIRgLh+/fJ1QXrnIvHNmmuawOnq+TUe+S01pShYaDa8oqIAdWIhH/HIDYjPsM5nU7ainN+ZYVyqtj9LlLBehFUa5Y74eyPFucwngugLi3A+Rf2lfekDt2G0Aw2GIZaaZxlWk5p6+zgmr4V8zAzhkG5RU7RJxsC8eZogijmiAM1atkNNs5X5zs9QBmQksWQ5H8YOWfl2sF9DOBrLo4+YTqVw0aWyG0hYr5fwv04Dl2JJ4W9vDDLPXzKo3A2QkRMhB3AfsKhZzdeE/BxuXsViZLGvWXEDNkLNI4X87sk7dOiH5ifO3gAbRwJG/csnHN0+I2I5zDrARaHxS/jIY55kec+1Ex1OvEbnPxPuTh3AYAD4SPX51pFtdpHhaBXK+cq/LzabmJvE0MhfAQ5nnNqsAmpahlSd9rgZAcbuQ/g8Yxk6QSDjG7UxnrQWhmgavVNyOt1n0zWJkIvRpo9nSG1oCdaBSw2DWnbIF/J+w+YGbcc=; domain=.hp.com; expires=Thu

Why it is truncating? Is there any way i can retrieve the full value?

Solved Solved
1 14 649
1 ACCEPTED SOLUTION

@krishna.prasadm ,

It's by design, If any comma is present in the string Apigee treats it as a multi-valued header.

Instead of ,

response.header.HPSession

Use ,

response.header.HPSession.values

See more details regarding same here.

View solution in original post

14 REPLIES 14

Hi @krishna.prasadm

Are you seeing this in trace ? How are you setting this value to a variable ?

Not applicable

In the trace I can see full information :

I tried both java script and Assign message policy

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <AssignMessage async="false" continueOnError="false" enabled="true" name="extractHPPSession"> <DisplayName>extractHPPSession</DisplayName> <Properties/> <AssignVariable> <Name>HPPSession</Name> <Value/> <Ref>response.header.Set-Cookie</Ref> </AssignVariable> <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables> </AssignMessage>

Former Community Member
Not applicable

So where is the value of the variable truncating? Is it when you see the value of the variable in the trace tool?

no when i retrive the value to the variraible ..

Former Community Member
Not applicable

Ok, so my question is how do you know that value in the variable is truncated? Are you the checking the value of the variable somewhere in a condition or something? Maybe helpful if you can share your proxy bundle here.

I have printed the value in the trace print command and stored that value as the accesstoken attribute, both the places it is truncating ..

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <AssignMessage async="false" continueOnError="false" enabled="true" name="extractHPPSession"> <DisplayName>extractHPPSession</DisplayName> <Properties/> <AssignVariable> <Name>HPPSession</Name> <Value/> <Ref>response.header.Set-Cookie</Ref> </AssignVariable> <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables> </AssignMessage>

i am using above assign message policy to retrieve the vlaue.

attached is the proxy bundle, which simulate the issuerestrunc-rev1-2016-06-23.zip

Former Community Member
Not applicable

Hi @krishna.prasadm just curious why the value of HPPSESSION seems to be different in the first section vs the other?

that i took from two different calls, but same length for the two strings

Former Community Member
Not applicable

Where are you seeing the truncated value? In the trace window? Here is a thread on how you can write the output of the header variable.

Trace is showing correct when I extract the value to the variable, then it is truncation. I am using assignmessage policy, even i tried java script also ..

@krishna.prasadm ,

It's by design, If any comma is present in the string Apigee treats it as a multi-valued header.

Instead of ,

response.header.HPSession

Use ,

response.header.HPSession.values

See more details regarding same here.

hmmm .. values seems to be working . But the other one, APIgee is putting restriction over HTTP 😞

@krishna.prasadm , Glad it worked. Can you please clarify what do you mean "Apigee is putting restriction over HTTP" ?