cubicdaiya / ngx_dynamic_upstream

Dynamic upstream for nginx
Other
501 stars 108 forks source link

fix README API example #28

Closed CaterpillarSan closed 5 years ago

CaterpillarSan commented 5 years ago

I noticed that your example written in README.md went wrong (in my environment), because query param order of "add" and "remove" APIs are incorrect😭🕰👻

my env:

correction: ❌ curl "http://127.0.0.1:6000/dynamic?upstream=zone_for_backends&add=&server=127.0.0.1:6004" ✔️ curl "http://127.0.0.1:6000/dynamic?upstream=zone_for_backends&server=127.0.0.1:6004&add="

It's because query params store not in a map but in an array, I think. https://github.com/cubicdaiya/ngx_dynamic_upstream/blob/cc5dac336d48ce184004c9dd93fce39af896587f/src/ngx_dynamic_upstream_op.c#L70

Please check it and merge if necessary.

CaterpillarSan commented 5 years ago

sorry I was misunderstanding