diff options
author | Adam Chlipala <adam@chlipala.net> | 2011-06-24 13:50:59 -0400 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2011-06-24 13:50:59 -0400 |
commit | f6784e37d5a512432ece6e0e89bb9e253de58a2f (patch) | |
tree | c714756284742c85cf82e7ea9b20de3a54626ccd /src | |
parent | f4416ce8fb29f7cd967bca7d66333dd7c4415243 (diff) |
'noXsrfProtection' .urp directive
Diffstat (limited to 'src')
-rw-r--r-- | src/cjr_print.sml | 2 | ||||
-rw-r--r-- | src/compiler.sml | 1 | ||||
-rw-r--r-- | src/settings.sig | 5 | ||||
-rw-r--r-- | src/settings.sml | 6 |
4 files changed, 11 insertions, 3 deletions
diff --git a/src/cjr_print.sml b/src/cjr_print.sml index f2455636..9b747bcb 100644 --- a/src/cjr_print.sml +++ b/src/cjr_print.sml @@ -2619,7 +2619,7 @@ fun p_file env (ds, ps) = newline, string "if (*request == '/') ++request;", newline, - if couldWrite ek then + if couldWrite ek andalso not (Settings.checkNoXsrfProtection s) then box [string "{", newline, string "uw_Basis_string sig = ", diff --git a/src/compiler.sml b/src/compiler.sml index 75fc015f..229b40ff 100644 --- a/src/compiler.sml +++ b/src/compiler.sml @@ -780,6 +780,7 @@ fun parseUrp' accLibs fname = NONE => ErrorMsg.error ("invalid min heap '" ^ arg ^ "'") | SOME n => minHeap := n) | "alwaysInline" => Settings.addAlwaysInline arg + | "noXsrfProtection" => Settings.addNoXsrfProtection arg | _ => ErrorMsg.error ("Unrecognized command '" ^ cmd ^ "'"); read () diff --git a/src/settings.sig b/src/settings.sig index d5383bca..e3c2e7cd 100644 --- a/src/settings.sig +++ b/src/settings.sig @@ -1,4 +1,4 @@ -(* Copyright (c) 2008-2010, Adam Chlipala +(* Copyright (c) 2008-2011, Adam Chlipala * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -227,4 +227,7 @@ signature SETTINGS = sig val addAlwaysInline : string -> unit val checkAlwaysInline : string -> bool + + val addNoXsrfProtection : string -> unit + val checkNoXsrfProtection : string -> bool end diff --git a/src/settings.sml b/src/settings.sml index 69d67959..26aaad95 100644 --- a/src/settings.sml +++ b/src/settings.sml @@ -1,4 +1,4 @@ -(* Copyright (c) 2008-2010, Adam Chlipala +(* Copyright (c) 2008-2011, Adam Chlipala * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -570,4 +570,8 @@ val alwaysInline = ref SS.empty fun addAlwaysInline s = alwaysInline := SS.add (!alwaysInline, s) fun checkAlwaysInline s = SS.member (!alwaysInline, s) +val noXsrfProtection = ref SS.empty +fun addNoXsrfProtection s = noXsrfProtection := SS.add (!noXsrfProtection, s) +fun checkNoXsrfProtection s = SS.member (!noXsrfProtection, s) + end |