Skip to content

Instantly share code, notes, and snippets.

@aSapien
aSapien / Example.scala
Last active June 10, 2020 10:14
ERROR: Result type in structural refinement may not refer to a user-defined value class
object Example extends App {
/**
* Structural Types
* */
// define a type based on its structure. Doesn't have to be named.
type StructuralToLong = { def toLong: Long }
// Use this type:
def workToLong1(a: StructuralToLong): Long = a.toLong // using named type
@aSapien
aSapien / axios_proxy_bypass.md
Last active October 31, 2020 14:54
[axios proxy bypass] #ssrf

Axios proxy bypass

  1. The proxy settings are defined in the top level config.
  2. Upon the initial reqest, an httpAdapter is resolved, and within it, the transport type which can be [http(s) (native), follow-redirect.http, follow-redirect.http].
  • When redirects are disabled, the native http transport is chosen
  • When redirects are enabled, then:
    • No proxy is set: follow-redirect.http
    • An http proxy is set: follow-redirect.http
    • An https proxy is set: follow-redirect.https
  1. follow-redirect has 613 npm packages depending on it. Some popular are axios, tinyreq and node-rest-client.