VibhorGupta1991 commented on issue #8185:
URL: https://github.com/apache/trafficserver/issues/8185#issuecomment-903724623


   Hi @shukitchan ,
   
   I was able to make it work by attaching the response transform hook only 
when the response code is 200 using the code below.
   
   function read_response()
           local code =ts.server_response.get_status()
           if code == 200 then
           ts.hook(TS_LUA_RESPONSE_TRANSFORM,modify_response)
           end
   end
   function do_remap()
           ts.hook(TS_LUA_HOOK_READ_RESPONSE_HDR,read_response)
           return 0
   end
   
   
   Do you think it is okay to attach a hook inside another hook callback 
function? It does work but just want to know if it is something that shouldn't 
be done. 
   
   Thanks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to