<p dir="auto">Hello, thanks for sharing your great work.</p>
<h4 dir="auto">Summary</h4>
<p dir="auto">We need to sign request before they are sent, that is : add a header with an ECDSA signature calculated with full request URL (including parameters) and body, to ensure they are not modified when they reach the server.</p>
<p dir="auto">In order to verify the signature, server software needs to rebuild data used to calculate the signature, using received request. Hence client (which uses axios and redux-axios-middleware) must sign with actual request data, which leads us in following issue : final url with querystring isn't built before request object construct (here for xhr : </p><div class="Box Box--condensed my-2">
  <div class="Box-header f6">
    <p class="mb-0 text-bold">
      <a href="https://github.com/axios/axios/blob/0b3db5d87a60a1ad8b0dce9669dbc10483ec33da/lib/adapters/xhr.js#L45">axios/lib/adapters/xhr.js</a>
    </p>
    <p class="mb-0 color-fg-muted">
         Line 45
      in
      <a data-pjax="true" class="commit-tease-sha" href="/axios/axios/commit/0b3db5d87a60a1ad8b0dce9669dbc10483ec33da">0b3db5d</a>
    </p>
  </div>
  <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
    <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">

        <tbody><tr class="border-0">
          <td id="L45" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="45"></td>
          <td id="LC45" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">request</span><span class="pl-kos">.</span><span class="pl-en">open</span><span class="pl-kos">(</span><span class="pl-s1">config</span><span class="pl-kos">.</span><span class="pl-c1">method</span><span class="pl-kos">.</span><span class="pl-en">toUpperCase</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-s1">buildURL</span><span class="pl-kos">(</span><span class="pl-s1">config</span><span class="pl-kos">.</span><span class="pl-c1">url</span><span class="pl-kos">,</span> <span class="pl-s1">config</span><span class="pl-kos">.</span><span class="pl-c1">params</span><span class="pl-kos">,</span> <span class="pl-s1">config</span><span class="pl-kos">.</span><span class="pl-c1">paramsSerializer</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-c1">true</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>
    </tbody></table>
  </div>
</div>
)<p></p>
<p dir="auto">As for now, I see two options to achieve this, both unsatisfying :</p>
<ul dir="auto">
<li>pass a custom paramSerializer, build the signature in an interceptor using it, and let axios rebuild the actual request url. Problem here is that url is built 2 times, leading to potential differences, not to mention unnecessary runtime overhead.</li>
<li>write a whole custom adapter, which handles the signing stuff, which would involve a lot of code duplication since we cannot easily access to axios' core, helpers &amp; utils from outside the lib.</li>
</ul>
<p dir="auto">Ideal situation would be an access to final url at interceptor's level (or in transformers ?).<br>
Do you see a better way to achieve this that I would have missed ?</p>
<h4 dir="auto">Context</h4>
<ul dir="auto">
<li>axios version: v0.18.0</li>
<li>Environment: whatever</li>
</ul>
<h2 dir="auto">Describe the bug</h2>
<p dir="auto">getting this error from the definitions via yarn2.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="➤ YN0000: [@bb/common-framework]: ../../../../../.yarn/cache/axios-npm-0.20.0-535d9e0086-6cf2e96317.zip/node_modules/axios/index.d.ts(63,40): error TS2304: Cannot find name 'ProgressEvent'."><pre class="notranslate"><code class="notranslate">➤ YN0000: [@bb/common-framework]: ../../../../../.yarn/cache/axios-npm-0.20.0-535d9e0086-6cf2e96317.zip/node_modules/axios/index.d.ts(63,40): error TS2304: Cannot find name 'ProgressEvent'.
</code></pre></div>
<p dir="auto">this is from</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="└─ axios@npm:0.20.0
   ├─ Version: 0.20.0
   │
   └─ Dependencies
      └─ follow-redirects@npm:^1.10.0 → npm:1.13.0"><pre class="notranslate"><code class="notranslate">└─ axios@npm:0.20.0
   ├─ Version: 0.20.0
   │
   └─ Dependencies
      └─ follow-redirects@npm:^1.10.0 → npm:1.13.0
</code></pre></div>
<p dir="auto">doesn't happen if I use 0.19.2. I don't have any usage of <code class="notranslate">ProgressEvent</code> myself.</p>
<h4 dir="auto">To Reproduce</h4>
<p dir="auto">I suspect putting this in a typescript file, and built with yarn2 is enough, it might actually be a bug in <code class="notranslate">axios-logger</code></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import { AxiosLogger } from '@new10com/axios-logger';"><pre class="notranslate"><code class="notranslate">import { AxiosLogger } from '@new10com/axios-logger';
</code></pre></div>
<h4 dir="auto">Expected behavior</h4>
<p dir="auto">A clear and concise description of what you expected to happen.</p>
<h4 dir="auto">Environment</h4>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="├─ @bb/common-framework@workspace:ts/lib/common/packages/framework
│  └─ @new10com/axios-logger@npm:0.1.1 (via npm:^0.1.1)
│     └─ axios@npm:0.19.2 (via npm:^0.19)
│"><pre class="notranslate"><code class="notranslate">├─ @bb/common-framework@workspace:ts/lib/common/packages/framework
│  └─ @new10com/axios-logger@npm:0.1.1 (via npm:^0.1.1)
│     └─ axios@npm:0.19.2 (via npm:^0.19)
│
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt; node --version                                                    # services -&gt; feature/RS2-1243-logging $ — » +
v12.18.3
&gt; yarn :g:tsc --version                                        # services -&gt; feature/RS2-1243-logging $ — » + RC=1
Version 4.0.3"><pre class="notranslate"><code class="notranslate">&gt; node --version                                                    # services -&gt; feature/RS2-1243-logging $ — » +
v12.18.3
&gt; yarn :g:tsc --version                                        # services -&gt; feature/RS2-1243-logging $ — » + RC=1
Version 4.0.3
</code></pre></div>
<h4 dir="auto">Additional context/Screenshots</h4>
<p dir="auto">Add any other context about the problem here. If applicable, add screenshots to help explain.</p>