Comments (4)
This also means that anyone can create a stack trace on a prologue server by requesting any URL with a forbidden character, regardless of if the server have a route with this forbidden character on. This does not seem to be a good design I believe.
from prologue.
See similar issue in #163
Reference: https://www.ietf.org/rfc/rfc2396.txt
The path may consist of a sequence of path segments separated by a single slash "/" character. Within a path segment, the characters "/", ";", "=", and "?" are reserved. Each path segment may include a sequence of parameters, indicated by the semicolon ";" character. The parameters are not significant to the parsing of relative references.
That means that in the path part of the URL (before the ?
indicating the query string and after the host part) all characters are allowed except /
(path delimiters), ;
(path segment parameter), =
(within the parameter ???) and ?
(start of the query string). Path segment parameters is so rarely used I believe we can skip this. This means that any character can appear except ?
(and %
reserved for escapes of course).
from prologue.
I agree, it shouldn't check whether the requested path is a valid URL =>
prologue/src/prologue/core/route.nim
Line 471 in cec75e8
from prologue.
After #183 is merged, you can use regex route like below
import prologue
proc hello*(ctx: Context) {.async.} =
resp "<h1>Hello, Prologue!</h1>"
let app = newApp()
app.get("/", hello)
app.addRoute(re"/@group", hello)
app.run()
from prologue.
Related Issues (20)
- Improve docs for retrieving settings
- Provide a debug log message when a route is added to prologue
- Error: unhandled exception: cannot read from file HOT 1
- Help with unknown error: "Error: type mismatch: got <Prologue, HttpCode, proc (ctx: Context): Future[system.void]{.locks: <unknown>.}>" HOT 2
- RFC - Add generic proc to parse `FormPart` into a nim object type HOT 1
- Trouble running with --threads:on HOT 2
- Error: You do not have permission to access this file. HOT 2
- Add docs that provide a general approach to testing prologue
- Feature Request: Middleware to map exceptions to response status codes
- Empty memorysession when route contains path params
- Enable subpixel hinting for fonts in the documentation
- FormPart does not handle multiple selections correctly HOT 1
- SIGSEV with --mm:orc and --threads:on HOT 1
- Is there a way to return HTTP 204 No Content without Content-Length and Content-Type headers?
- Getting client IP information (like in Jester) HOT 1
- Cannot serve dynamic websites HOT 2
- Type mismatch error HOT 1
- SIGSEGV: Illegal storage access. (Attempt to read from nil?) HOT 9
- how to access global shared variables in async handler
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 prologue.