Skip to content

Add a few built-in matchers for HttpServer #3077

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
justinfagnani opened this issue May 16, 2012 · 4 comments
Closed

Add a few built-in matchers for HttpServer #3077

justinfagnani opened this issue May 16, 2012 · 4 comments
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-as-intended Closed as the reported issue is expected behavior library-io P3 A lower priority bug or feature request type-enhancement A request for a change that isn't a bug

Comments

@justinfagnani
Copy link
Contributor

It'd be very useful to have a few common matcher functions included with the HttpServer:

Matching on URL is common, so these two would be useful:

  • Exact URL match: url("/my/url")
  • Regex on URL: pattern("/resource/(\d*)")
@sethladd
Copy link
Contributor

cc @sgjesse.
Removed Type-Defect label.
Added Type-Enhancement, Area-IO, Triaged labels.

@sgjesse
Copy link
Contributor

sgjesse commented May 22, 2012

As the simple matchers can be written as one-liners I don't an immediate need for this.

HttpServer server = ...

// Prefix matching.
server.addHandler((request) => request.path.startsWith("/xxx/yyy/"), ...);

// RegExp matching.
server.addHandler((request) => new RegExp("^/xxx").hasMatch(request.path), ...);

// Exact match.
server.addHandler((request) => request.path == "/yyy.dat", ...);

// Postfix match.
server.addHandler((request) => request.path.endsWith(".dat"), ...);


Removed Priority-Medium label.
Added Priority-Low label.

@madsager
Copy link
Contributor

I agree with Søren's comment. These are so simple to define yourself that I don't think they belong in the dart:io library.


Added AsDesigned label.

@kevmoo
Copy link
Member

kevmoo commented May 14, 2014

Removed Area-IO label.
Added Area-Library, Library-IO labels.

@justinfagnani justinfagnani added Type-Enhancement P3 A lower priority bug or feature request area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-io closed-as-intended Closed as the reported issue is expected behavior labels May 14, 2014
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed type-enhancement labels Mar 1, 2016
copybara-service bot pushed a commit that referenced this issue Jul 12, 2022
…4 revisions)

https://dart.googlesource.com/dartdoc/+log/adc5a45ddafb..621c9192cc24

2022-07-12 [email protected] Move annotation tests out of end-to-end test (#3078)
2022-07-11 [email protected] Move test skip above test body (#3076)
2022-07-11 [email protected] Remove ElementType.returnedFrom; was completely unused (#3077)
2022-07-09 [email protected] Make Mixin.superclassConstraints late final non-nullable (#3075)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-doc-dart-sdk
Please CC [email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Dart Documentation Generator: https://github.com/dart-lang/dartdoc/issues
To file a bug in Dart SDK: https://github.com/dart-lang/sdk/issues

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Tbr: [email protected]
Change-Id: I82e92bf6c915969b2ba72de470939673f63b4de9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251161
Commit-Queue: Nate Bosch <[email protected]>
Reviewed-by: Nate Bosch <[email protected]>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-as-intended Closed as the reported issue is expected behavior library-io P3 A lower priority bug or feature request type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

5 participants