aboutsummaryrefslogtreecommitdiffstats
path: root/libpathod/templates/response_previewform.html
blob: 93d5960a1c9970f833f13343ce0806b9c5f1eb26 (plain)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<form class="form-inline" method="GET" action="/response_preview">
    <input 
        style="width: 20em"
        id="spec"
        name="spec"
        class="input-medium search-query"
        value="{{spec}}"
        placeholder="code[msg]:[features]"
    >
    <input type="submit" class="btn" value="preview">
    {% if not nocraft %}
    <a href="#" id="submitspec" class="btn">go to</a>
    {% endif %}
</form>

<a data-toggle="collapse" data-target="#responseexamples">more examples...</a>
<div id="responseexamples" class="collapse">
    <table class="table table-bordered">
        <tbody >
            <tr>
                <td><a href="/response_preview?spec=200">200</a></td>
                <td>A basic HTTP 200 response</td>
            </tr>
        </tbody>
        <tbody >
            <tr>
                <td><a href="/response_preview?spec=200:b@100">200:b@100</a></td>
                <td>100 random bytes as the body</td>
            </tr>
        </tbody>
        <tbody >
            <tr>
                <td><a href='/response_preview?spec=200:b@100:h"Server"="&apos;;drop table servers;"'>200:b@100:h"Etag"="';drop table servers;"</a></td>
                <td>Add a Server header</td>
            </tr>
        </tbody>
        <tbody>
            <tr>
                <td><a href="/response_preview?spec=200:b@100:dr">200:b@100:dr</a></td>
                <td>Drop the connection randomly</td>
            </tr>
        </tbody>
        <tbody>
            <tr>
                <td><a href="/response_preview?spec=200:b@100,ascii:ir,@1">200:b@100,ascii:ir,@1</a></td>
                <td>100 ASCII bytes as the body, and randomly inject a random byte</td>
            </tr>
        </tbody>
    </table>
</div>

<script>
    $(function(){
        {% if not nocraft %}
        $("#submitspec").click(function(){
            document.location = "{{craftanchor}}" + $("#spec").val()
        });
        {% endif %}
    });
</script>