Git Product home page Git Product logo

Comments (4)

mildred avatar mildred commented on June 10, 2024

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.

mildred avatar mildred commented on June 10, 2024

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.

ringabout avatar ringabout commented on June 10, 2024

I agree, it shouldn't check whether the requested path is a valid URL =>

result = ctx.matchTree(ctx.gScope.router.data[reqMethod], ensureCorrectRoute(

from prologue.

ringabout avatar ringabout commented on June 10, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.