title: Add dynamic headers to NestJS HTTPService
body: <p>Let's say we have a GraphQL NestJS application which acts as a proxy between a client and a REST API server. It's got 3 layers:</p>
  <ol>
  <li>Resolver</li>
  <li>Services (which kinda have the business logic and stuff)</li>
  <li>Something extending <code>HTTPService</code> with added functionalities</li>
  </ol>
  <p>We want to add dynamic headers to NestJS outgoing requests to REST API server, which uses <code>axios</code>. The headers are based on:</p>
  <ol>
  <li>User: We can read user with the help of <code>User</code> decorator in resolver and pass it down to services, or read it from the GraphQL context as far as I know.</li>
  <li>Routes: Different endpoints may require different headers. I think we can specify the types of header that should be added because of a specific rout in the service, but this does not look so scalable... . Or maybe we can store an object of the current paths, that we make requests to. Intercept outgoing requests and use RegExp to determine which path is the request is being sent to (i.e. <code>user/3</code> would translate to <code>user/:id</code>, which we can add proper headers knowing that).</li>
  </ol>
  <pre><code>[
    {
      path: 'user/:id',
      ...
    },
    {
      path: 'user/:id/image',
      ...
    }
  ]
  </code></pre>
  <p>So my question is how can we add headers to outgoing requests from a NestJS application to some endpoints based on the path(url of the <code>axios</code> request) and the current user. Is matching a url with some RegExps while intercepting an outgoing request expensive?</p>