>>10
よく知らんが$http_response_headerあたりで拾えるんじゃないか?