Comments (2)
This kind of sounds like a stick to beat you with considering your param is rest and can contain both slashes and the next segment separator. I see multiple solutions without expanding the params API (which has little to none room left):
- make
repo
a non-rest parameter - have another separator segment like
/@/
instead of/-/
- encode your
repo
parameter
The rest parameters docs has an example demonstrating exactly what you are trying to do, is there anything different in your case?
from kit.
The rest parameters docs has an example demonstrating exactly what you are trying to do, is there anything different in your case?
The repository identifiers are relatively free form. The might match [codehost]/[org]/[repo]
but they could also just be [repo]
or any other pattern, e.g. on self-hosted instances.
- make
repo
a non-rest parameter- encode your
repo
parameter
It seems like these would have to go together since repo
cannot contain /
without being encoded. This is not practical in our case because it wouldn't work for existing links. And, to a lesser degree, it doesn't look good either.
have another separator segment like
/@/
instead of/-/
That would result in the same problem if file path contains /@/
anywhere. Also it would break existing links so changing the overall structure of these URLs is not really possible.
This kind of sounds like a stick to beat you with considering your param is rest and can contain both slashes and the next segment separator.
repo
cannot contain /-/
. That's one of the few restrictions and is encoded in the parameter matcher. That's why I was surprised that adding the matcher doesn't solve the problem. I expected the routing logic to match the whole path differently.
It's an existing application that I'm build a prototype in SvelteKit for.
I acknowledge that the situation is not ideal, but the server as well as the existing client is able to parse these URLs as desired. So it doesn't seem too unreasonable to allow more control over the parsing process, even if it's something that needs to be done carefully.
from kit.
Related Issues (20)
- enhanced:img should be considered a void element HOT 2
- "svelte-package" --tsconfig option ignores everything but compilerOptions
- Inflight Deprecation Warning HOT 19
- adapter-node upgrade lead to Memory Leak on SSR HOT 3
- svelte.config.js version changes cause most client chunks to generate a new hash despite no other changes HOT 7
- enhanced:img, imagetools, Sharp, and incorrectly rotated images HOT 6
- Cloudflare's Invocation routes cannot be replaced/extended [adapter-cloudflare] HOT 1
- `read()` does not support filename with space on macOS HOT 2
- `read()` does not support pathnames with `[param]` on macOS HOT 1
- Crawler does not crawl absolute URIs even if they are on `prerender.origin` HOT 1
- Static Site Generation HOT 2
- Override `vite/client` definitions
- adapter-cloudflare-workers: platformProxy persist configuration example is wrong HOT 1
- SVGs which are imported and used as a `background-image` via a CSS variable get incorrectly encoded as a data URI during build HOT 1
- Page won't auto reload during development if CSR is disabled HOT 2
- Source Code permission HOT 5
- Adapter vercel split option breaks form action HOT 1
- review which APIs are async vs not HOT 3
- Typescript is not happy when using the `error` method HOT 2
- `$page.data` and `data` prop have different values
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kit.