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.

Automatic Rules PeriodicArchiver should not use HTTP requests to self

See original GitHub issue
        // FIXME using an HTTP request to localhost here works well enough, but is needlessly
        // complex. The API handler targeted here should be refactored to extract the logic that
        // creates the recording from the logic that simply figures out the recording parameters
        // from the POST form, path param, and headers. Then the handler should consume the API
        // exposed by this refactored chunk, and this refactored chunk can also be consumed here
        // rather than firing HTTP requests to ourselves

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
andrewazorescommented, Jul 6, 2021

I think what’s happening there is that you’re created an object called spy, which wraps around the archiver instance, and has your customized behaviour (throw an exception when performArchival is called), but this doesn’t actually change the behaviour of archiver - only spy.

If the archiver is modified so that run/performArchival no longer use webClient but instead use targetConnectionManager instead, then you would modify the targetConnectionManager spy/mock so that it throws an exception when some method that run/performArchival calls is called.

1reaction
andrewazorescommented, Jul 2, 2021

You could probably put it into RecordingCreationHelper and just rename that class to something a little more general.

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTTP/1.1: Connections
HTTP requests and responses can be pipelined on a connection. ... Clients SHOULD NOT pipeline requests using non-idempotent methods or non-idempotent ...
Read more >
An overview of HTTP - MDN Web Docs
HTTP is a protocol for fetching resources such as HTML documents. It is the foundation of any data exchange on the Web and...
Read more >
HTTP requests - IBM
An HTTP request is made by a client, to a named host, which is located on a server. The aim of the request...
Read more >
HTTP request smuggling - Web Security Academy - PortSwigger
In this section, we'll explain HTTP request smuggling attacks and describe how common request smuggling vulnerabilities can arise. Labs If you're already ....
Read more >
RFC 2616: Hypertext Transfer Protocol -- HTTP/1.1
The asterisk "*" means that the request does not apply to a particular resource, but to the server itself, and is only allowed...
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