Skip to content

Latest commit

 

History

History
75 lines (56 loc) · 1.85 KB

README.md

File metadata and controls

75 lines (56 loc) · 1.85 KB

caddy-argsort

Build and test Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public. GoDoc Go Report Card

This is a caddy plugin. Works with caddy 2. Sort the request query arguments. Optionally case insensitive.

Usage

Set the module order

You will need to specify the execution order of this module in your caddyfile. This is done in the global options block.

{
    ...
    order argsort before header
    ...
}

Simple usage

Once the order has been set in the global options block, use argsort in any server block

{
    order argsort before header
}

:8881 {
    header Content-Type "text/html; charset=utf-8"
    respond "Hello."
    argsort
}

Optional case insensitive usage

Once the order has been set in the global options block, use argsort lowecase in any server block

{
    order argsort before header
}

:8881 {
    header Content-Type "text/html; charset=utf-8"
    respond "Hello."
    argsort lowercase
}

Forward the normalized request to an upstream

Once the order has been set in the global options block, you ensure query arguments sorting for an upstream server

{
    order argsort before header
}

:8882 {
    argsort
    reverse_proxy localhost:8883
}

:8883 {
    header Content-Type "text/html; charset=utf-8"
    respond "Hello."
}