question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

requestor job to support additional headers

See original GitHub issue

This is a note from Simon - Please raise an enhancement request issue for the requestor job to support additional headers - these should support env vars which will allow you to specify the bearer token.

This is the issue / feature I would request:

I set up a requestor for a valid request that I captured. The requestor does not let me add the bearer token needed for authorization.

For example, this is the request as captured:

POST https://api.mydomain.com/search HTTP/1.1
Content-Type: application/json
Authorization: Bearer <A Bunch of data that represents the token...>
Content-Length: 162
Host: api.mydomain .com
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.5.12 (Java/11.0.12)

{<SOME DATA>}

The request job in the yaml looks like this:

jobs:
- parameters:
    user: ""
  requests:
  - url: "https://api.mydomain.com/search"
    name: ""
    method: "POST"
    data: "{<SOME DATA>}"
    responseCode: 200
  name: "requestor"
  type: "requestor"

Can I somehow paste the valid token in the yaml file? If so what is the syntax?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:27 (27 by maintainers)

github_iconTop GitHub Comments

1reaction
njmulsqbcommented, Sep 21, 2022

So as discussed in IRC channel, the solution to above issue is that I wasn’t deploying the changes to Zap Add on, each code change needs to be replicated to the addon file as zap reads the changes from addon file. The solution is to run gradlew addOns:automation:copyZapAddOn when Zap changes needs to be deployed. This needs to be run whenever I want to see the changes. To check if the addon is deployed properly or not, go to zap --> addons --> automation --> click on it and see where the plugins are being stored, go to that directory and check if the addon file (automation-beta) in this case has updated or not?

1reaction
thc202commented, Sep 19, 2022

an error is being thrown

You need to provide more details, the JobUtils is able to copy List.

but this seems to be just a workaround.

No, it’s not a workaround it’s what needs to be done, otherwise you are breaking other add-ons that are using that constructor.

Can these comments be added to ZAP?

Make sure it’s proper JavaDoc rather than plain code comments though.

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTTP headers - MDN Web Docs - Mozilla
HTTP headers let the client and the server pass additional information with an HTTP request or response. An HTTP header consists of its ......
Read more >
Adding custom headers to origin requests - Amazon CloudFront
To configure a distribution to add custom headers to requests that it sends to your origin, update the origin configuration using one of...
Read more >
How do I add custom headers to a request (ASP.Net 2.0)?
I have a need to add custom headers to a request before it is processed. I first created an HttpModule but quickly found...
Read more >
How do I send GET Request with Custom Headers? - ReqBin
Custom headers are intended to provide additional information related to the current request or response, or for troubleshooting purposes. Custom header fields ...
Read more >
Create custom headers in backend services | Load Balancing
Working with custom request headers · Go to the load balancing summary page. · Click Backends. · Click the name of a backend...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found