roadrunner-server / roadrunner-plugins

📦 Home for the roadrunner plugins
MIT License
25 stars 9 forks source link

feat(http, uploads): add `allow` option #134

Closed rustatian closed 2 years ago

rustatian commented 2 years ago

Reason for This PR

Description of Changes

Config:

http:
  address: 127.0.0.1:18903
  max_request_size: 1024
  middleware: ["pluginMiddleware", "pluginMiddleware2"]
  uploads:
    forbid: [".php", ".exe", ".bat"]
    allow: [".html", ".aaa" ] <------------- NEW
  trusted_subnets:
    [
      "10.0.0.0/8",
      "127.0.0.0/8",
      "172.16.0.0/12",
      "192.168.0.0/16",
      "::1/128",
      "fc00::/7",
      "fe80::/10",
    ]
  pool:
    num_workers: 2
    max_jobs: 0
    allocate_timeout: 60s
    destroy_timeout: 60s

License Acceptance

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

PR Checklist

[Author TODO: Meet these criteria.] [Reviewer TODO: Verify that these criteria are met. Request changes if not]

codecov[bot] commented 2 years ago

Codecov Report

Merging #134 (d6e8b55) into master (62c5131) will increase coverage by 0.22%. The diff coverage is 94.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #134      +/-   ##
==========================================
+ Coverage   65.10%   65.33%   +0.22%     
==========================================
  Files         138      138              
  Lines       10987    11007      +20     
==========================================
+ Hits         7153     7191      +38     
+ Misses       3109     3094      -15     
+ Partials      725      722       -3     
Impacted Files Coverage Δ
http/config/uploads_config.go 86.95% <84.21%> (-13.05%) :arrow_down:
http/handler/handler.go 81.05% <100.00%> (+0.40%) :arrow_up:
http/handler/parse.go 95.87% <100.00%> (-0.05%) :arrow_down:
http/handler/request.go 78.48% <100.00%> (ø)
http/handler/uploads.go 80.88% <100.00%> (+7.11%) :arrow_up:
http/plugin.go 77.30% <100.00%> (+0.32%) :arrow_up:
tcp/plugin.go 72.17% <0.00%> (+0.86%) :arrow_up:
redis/pubsub/pubsub.go 72.86% <0.00%> (+2.32%) :arrow_up:
boltdb/boltjobs/listener.go 64.15% <0.00%> (+2.83%) :arrow_up:
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 62c5131...d6e8b55. Read the comment docs.