Hi Greg--

I understand that you want the '/download/' URL to bypass the Webassembly
service-worker.
Server-side, I'd old-school a server-rewrite (mod-rewrite / IISRewrite /
custom HTTPFilter) or Fiddle the site config handlers.  **sighs**

I found a SO article describing a deployment issue with escaping static
'/swagger' processing (worked OK on kestrel, but broke on IIS; something to
do with Browser cache?)
The solution was to edit  the '*onfetch(event)*' *function *in
*service-worker.published.js* in the *Blazor WebAssembly Client "wwwroot"
folder *and add a url exclusion for the /swagger folder.

   - URL Rewrite exceptions for Blazor WebAssembly Hosted deployment
   
<https://stackoverflow.com/questions/62073764/url-rewrite-exceptions-for-blazor-webassembly-hosted-deployment>


Perhaps this will work for '/downloads/' too?  e.g.

File: * service-worker.published.js*  (You might need to use
'service-worker.js')

--------------------------------

async function *onFetch*(event) {
   .
   .

const shouldServeIndexHtml = event.request.mode === 'navigate'
            && !event.request.url.includes('/connect/')
            && !event.request.url.includes('/Identity/')*
&& !event.request.url.includes('/**download**/');*

   .
   .

}

HTH

Dan C.



On Mon, 22 Mar 2021 at 13:32, Greg Keogh <gfke...@gmail.com> wrote:

> (UHF communication band established again)
>
> I have a question about Blazor Webassembly app routing, but I think Blazor
> uses the same routing logic as MVC (I think) so the question might be more
> general.
>
> Is there a way of configuring some routes to be ignored and passed on to
> be processed as static content?
>
> For example I want anything under /download/ to be ignored by the Blazor
> spp and just be static files for download. I've searched until my fingers
> ache, but I'll bet there's a trick I'm missing .. I hope.
>
> *Greg K*
>


-- 
Dan Cash
-m. 0411 468 779
-e. dan.c...@gmail.com

F.A.B. Information Systems Pty Ltd   ABN 16 084 146 261

Reply via email to