-
Notifications
You must be signed in to change notification settings - Fork 0
/
cors.als
37 lines (29 loc) · 1.24 KB
/
cors.als
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
open declarations
/************************************
* CORS
*
************************************/
sig PreFlightRequest extends HTTPRequest {}{
method = OPTIONS
some headers & AccessControlRequestMethod
some headers & OriginHeader
some headers & AccessControlRequestHeaders
}
fact PreFlightIsAlwaysCrossOrigin{
all pfr:PreFlightRequest | isCrossOriginRequest[pfr]
}
abstract sig CORSResponseHeader extends HTTPResponseHeader{}
sig AccessControlAllowOrigin extends CORSResponseHeader {origin: Origin}
sig AccessControlAllowMethods extends CORSResponseHeader {allowedMethods : set Method}
sig AccessControlAllowHeaders extends CORSResponseHeader {allowedHeaders : set HTTPRequestHeader}
sig AccessControlMaxAge,AccessControlAllowCredentials extends CORSResponseHeader{}
abstract sig CORSRequestHeader extends HTTPRequestHeader{}
sig AccessControlRequestMethod extends CORSRequestHeader {requestedMethod : Method}
sig AccessControlRequestHeaders extends CORSRequestHeader {requestedHeaders : set HTTPRequestHeader}
run show {} for 6
/* Execution result:
Executing "Run show for 6"
Solver=sat4j Bitwidth=4 MaxSeq=6 SkolemDepth=1 Symmetry=20
32458 vars. 1798 primary vars. 65424 clauses. 52047ms.
Instance found. Predicate is consistent. 201ms.
*/