vercel / serve-handler

The foundation of `serve`

Home Page:https://npmjs.com/serve-handler

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to keep utm parameters in redirects?

KevinDanikowski opened this issue · comments

I have redirects I'd like to implement, but I'm not seeing a way to keep them from stripping the query parameters. Is there anyways I can keep utm_val=something in my config?

{ 
  "redirects": [ 
    {
      "source": "/oldpath?utm_val=something",
      "destination": "/newpath"
    } 
  ]
}

Desired Behavior:

/oldpath?utm_val=something => /newpath?utm_val=something

Current Behavior:

/oldpath?utm_val=something => /newpath

After looking into it, currently this package doesn't support this ability. I have added the ability and created a PR for it.

PS: For anyone interested, I made this change and published @kevindanikowski/serve-handler 6.2.0 and @kevindanikowski/serve 12.0.0 with the updated dependency.

shameless self-promotion alert:
this feature is available in my @warren-bank/serve fork of serve