Ogeon / rustful

[OUTDATED] A light HTTP framework for Rust
https://docs.rs/rustful
Apache License 2.0
862 stars 52 forks source link

Make wildcards work as path variables #64

Closed Ogeon closed 9 years ago

Ogeon commented 9 years ago

This allows wildcards in TreeRouter to be named (e.x. head/*tail) and sent to the handler as variables. The purpose of this is to allow entire sections of the requested path to be captured as easy as individual segments currently is. This is very useful for requesting static files (see the updated handler_storage example).

Wildcards are also renamed to "variable sequences" and standard variables are now called "variable segments". Some occurrences of the old terminology will, however, still be used in internal parts for a while longer.

These changes are breaking if a project uses the LinkSegment type, or if it relies on nameless variables being available to the handler.

Ogeon commented 9 years ago

The terminology surrounding this has started to feel a bit odd, now when wildcards have become variables as well. It may be time to consider using better names for these things.

Ogeon commented 9 years ago

The new names are "variable segment" and "variable sequence". This may still change if better names appear before this is merged.

Ogeon commented 9 years ago

@homu r+

homu commented 9 years ago

:pushpin: Commit b387c57 has been approved by Ogeon

homu commented 9 years ago

:hourglass: Testing commit b387c57 with merge fbcb25d...

homu commented 9 years ago

:sunny: Test successful - status