class Amber::Router::Parsers::FormScanner

Overview

Splits a URL-encoded stream into decoded key and value pairs, the way URI::Params.parse does (& and ; separate pairs, + is a space), while enforcing the byte limits of Amber::Configuration::ParamsConfig as the bytes arrive.

The stream is read in blocks no larger than the remaining body allowance, and a raw key or value is rejected once it is longer than three times its decoded limit (percent-encoding uses at most three bytes per decoded byte). Nothing is decoded until its raw form is within bounds; ParamBudget#admit! then checks the exact decoded lengths.

Defined in:

amber/router/parsers/form_scanner.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(io : IO, limits : Amber::Configuration::ParamsConfig) #

[View source]

Instance Method Detail

def each_pair(& : String, String -> ) : Nil #

[View source]