I am dropping this https://github.com/zaproxy/community-scripts/blob/main/httpsender/add_header_request.py into ZAP scripts window > Proxy

When I save and browse a site, I see java.lang.reflect.UndeclaredThrowableException

I expected to see additional headers as in sample script above - can anyone help?

I am new to Zap scripting, after having a good hunt, I can find little on how this lang interfaces with Zap or any docs on it

I am on Windows.

  • We might need the full error or output, but this looks more like a Zap support issue than a security issue.
    – schroeder
    Oct 18, 2022 at 13:56

1 Answer 1


It looks from what you are saying that you've added this as a proxy script. Thats not right, its an httpsender script, so you need to add it as one of those.

  • Thanks - that helped! I also discovered your vid on them with the templates - so I was able to get it running - thank you. youtube.com/watch?v=ujL6rH6nVXI I used the template and changed for my needs under the HTTP Sender in the script tree.
    – phil_99
    Oct 18, 2022 at 15:14
  • Hello and welcome to Security.SE. I flagged this answer as I guess it should be a comment to @Simon Bennetts' answer. If it did help, perhaps you could mark their answer as "accepted" to help others that would have the same issue.
    – Yuriko
    Oct 18, 2022 at 15:23
  • Please don't add "thank you" as an answer. Instead, accept the answer that you found most helpful. - From Review
    – mentallurg
    Oct 18, 2022 at 18:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .