ソースを参照

Update readme

master
Skylar Ittner 1年前
コミット
f592ce0975
1個のファイルの変更19行の追加13行の削除
  1. 19
    13
      readme.md

+ 19
- 13
readme.md ファイルの表示

@@ -1,8 +1,8 @@
1 1
 <img src="https://source.netsyms.com/Netsyms/Captcheck/raw/master/logo.png" alt="Captcheck" style="max-width: 50%;" />
2 2
 
3 3
 
4
-Easy, light, self-hostable CAPTCHA service.  Works on modern browsers (and 
5
-IE9+).  Uses a selection of icons from Font-Awesome.  Text-only accessibility 
4
+Easy, light, self-hostable CAPTCHA service.  Works on modern browsers (and
5
+IE9+).  Uses a selection of icons from Font-Awesome.  Text-only accessibility
6 6
 mode and support for keyboard-only operation.
7 7
 
8 8
 Thanks to textcaptcha.com for supplying the data for the text CAPTCHA.
@@ -10,7 +10,7 @@ Thanks to textcaptcha.com for supplying the data for the text CAPTCHA.
10 10
 How to use
11 11
 ----------
12 12
 
13
-In your form, put an empty div with the class "captcheck_container". 
13
+In your form, put an empty div with the class "captcheck_container".
14 14
 Add `captcheck.js` (or `captcheck.dist.js`) into your page.
15 15
 
16 16
     <!DOCTYPE html>
@@ -31,22 +31,28 @@ Add `captcheck.js` (or `captcheck.dist.js`) into your page.
31 31
         </body>
32 32
     </html>
33 33
 
34
-When the form is submitted, your server will receive two extra form fields: 
34
+When the form is submitted, your server will receive two extra form fields:
35 35
 `captcheck_session_code` and `captcheck_selected_answer`.
36
-In your form handling code, send a request to `http(s)://captcheck-url/api.php`. 
37
-Pass the variables `session_id` and `answer_id` with the values sent with the form, 
38
-and also pass the variable `action` with the value `verify`.  
39
-You will receive a JSON response with (among other things) `"result": true` or 
40
-`"result": false`.  If result is false, the user failed the test, and another 
36
+In your form handling code, send a request to `http(s)://captcheck-url/api.php`.
37
+Pass the variables `session_id` and `answer_id` with the values sent with the form,
38
+and also pass the variable `action` with the value `verify`.
39
+You will receive a JSON response with (among other things) `"result": true` or
40
+`"result": false`.  If result is false, the user failed the test, and another
41 41
 variable `msg` is available with an explanation.
42 42
 
43
-Example URL:  
43
+Example URL:
44 44
 `http(s)://captcheck-url/api.php?action=verify&session_id=<captcheck_session_code>&answer_id=<captcheck_selected_answer>`
45 45
 
46
-Example responses:  
47
-`{"session":"some_session_id","result":true}`  
46
+Example responses:
47
+`{"session":"some_session_id","result":true}`
48 48
 `{"session":"some_session_id","result":false,"msg":"Answer incorrect."}`
49 49
 
50
+###Content-Security-Policy and Nonces
51
+
52
+Add `data-stylenonce="nonce_here"` to the `.captcheck_container` div.
53
+If you have multiple CAPTCHAs on one page, only one of them needs the nonce
54
+specified.
55
+
50 56
 
51 57
 Installation
52 58
 ------------
@@ -61,7 +67,7 @@ Installation
61 67
 Execution Flow
62 68
 --------------
63 69
 
64
-    JS = captcheck.js, API = api.php, FORM = parent form, 
70
+    JS = captcheck.js, API = api.php, FORM = parent form,
65 71
     SITE = form processing code, -> = some action taken on the right by the left
66 72
 
67 73
     JS -> API:      Request session ID, question, and answers (with scrambled random codes)

読み込み中…
キャンセル
保存