#2735·falcon

Add new argument to `req.get_param()` for refusing multiple values

Author: vytas7Created Sep 12, 2026Updated Sep 12, 2026
Labelsenhancementneeds-decisionproposal

At the time of writing, we explicitly warn that in the case a parameter is included in the query multiple times, req.get_param() returns one of them, but undefined which. (We actually return the last occurrence "for grins" .)

@jap has proposed to add a new argument to this method which would disallow multiple values, and raise an exception instead.

@CaselIT questioned the naming choice of "single" as ambiguous. What other names could fit?

  • require_single
  • require_scalar
  • allow_multiple (inverted compared to the above, default True)

Furthermore, should this only apply to req.get_param(), or any of the other helpers too?

Another thought @jap: what if multiple values are present, but they are all identical? Should we try to convert the list to set before raising, and consider it as "fine" if there is only one unique string? Thinking if some clients pass something twice by mistake. I'm probably gonna retract this part. On reconsideration, it would just make it confusing instead of bringing the strictness we're after here.