Skip to content

Commit

Permalink
Forbid cookie name with '='
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Lasson <marc.lasson@lexifi.com>
  • Loading branch information
mlasson committed May 9, 2019
1 parent 893f93f commit 867f99f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/lib_kind.ml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,17 @@ module Ppx_args = struct
let open Stanza.Decoder in
let* () = Syntax.since Stanza.syntax (1, 10) in
enter
(let+ name = string
and+ value = String_with_vars.decode in
{ name; value })
(
let+ name = plain_string
(fun loc str ->
if String.contains str '=' then
Errors.fail loc "Character '=' is not allowed in cookie names"
else
str
)
and+ value = String_with_vars.decode in
{ name; value }
)

let encode { name; value } =
let open Dune_lang in
Expand Down

0 comments on commit 867f99f

Please sign in to comment.