diff options
Diffstat (limited to 'libpathod')
-rw-r--r-- | libpathod/language.py | 7 | ||||
-rw-r--r-- | libpathod/templates/docs_lang.html | 51 | ||||
-rw-r--r-- | libpathod/templates/index.html | 2 | ||||
-rw-r--r-- | libpathod/templates/response_previewform.html | 2 |
4 files changed, 36 insertions, 26 deletions
diff --git a/libpathod/language.py b/libpathod/language.py index 7f1d8cec..76676517 100644 --- a/libpathod/language.py +++ b/libpathod/language.py @@ -586,7 +586,8 @@ class Reason(_Component): @classmethod def expr(klass): - e = Value.copy() + e = pp.Literal("m").suppress() + e = e + Value return e.setParseAction(lambda x: klass(*x)) def values(self, settings): @@ -724,7 +725,8 @@ class Response(Message): InjectAt, ShortcutContentType, ShortcutLocation, - Raw + Raw, + Reason ) logattrs = ["code", "reason", "version", "body"] def __init__(self): @@ -749,7 +751,6 @@ class Response(Message): resp = pp.And( [ Code.expr(), - pp.Optional(Reason.expr()), pp.ZeroOrMore(Sep + atom) ] ) diff --git a/libpathod/templates/docs_lang.html b/libpathod/templates/docs_lang.html index ebed7388..f01d61fb 100644 --- a/libpathod/templates/docs_lang.html +++ b/libpathod/templates/docs_lang.html @@ -17,18 +17,11 @@ <div class="tab-pane active" id="specifying_responses"> <p>The general form of a response is as follows:</p> - <pre class="example">code[MESSAGE]:[colon-separated list of features]</pre></p> + <pre class="example">code:[colon-separated list of features]</pre></p> <table class="table table-bordered"> <tbody > <tr> - <td> h<a href="#valuespec">VALUE</a>=<a href="#valuespec">VALUE</a> </td> - <td> - Set a header. - </td> - </tr> - - <tr> <td> b<a href="#valuespec">VALUE</a> </td> <td> Set the body. The appropriate Content-Length header is @@ -45,6 +38,21 @@ </tr> <tr> + <td> d<a href="#offsetspec">OFFSET</a> </td> + <td> + Disconnect after OFFSET bytes. + </td> + </tr> + + <tr> + <td> h<a href="#valuespec">VALUE</a>=<a href="#valuespec">VALUE</a> </td> + <td> + Set a header. + </td> + </tr> + + + <tr> <td> i<a href="#offsetspec">OFFSET</a>,<a href="#valuespec">VALUE</a> </td> <td> Inject the specified value at the offset. @@ -60,9 +68,10 @@ </tr> <tr> - <td> d<a href="#offsetspec">OFFSET</a> </td> + <td> m<a href="#valuespec">VALUE</a> </td> <td> - Disconnect after OFFSET bytes. + HTTP Reason message. Automatically chosen according to + the response code if not specified. </td> </tr> @@ -95,13 +104,6 @@ <table class="table table-bordered"> <tbody > <tr> - <td> h<a href="#valuespec">VALUE</a>=<a href="#valuespec">VALUE</a> </td> - <td> - Set a header. - </td> - </tr> - - <tr> <td> b<a href="#valuespec">VALUE</a> </td> <td> Set the body. The appropriate Content-Length header is @@ -118,16 +120,23 @@ </tr> <tr> - <td> i<a href="#offsetspec">OFFSET</a>,<a href="#valuespec">VALUE</a> </td> + <td> d<a href="#offsetspec">OFFSET</a> </td> <td> - Inject the specified value at the offset. + Disconnect after OFFSET bytes. </td> </tr> <tr> - <td> d<a href="#offsetspec">OFFSET</a> </td> + <td> h<a href="#valuespec">VALUE</a>=<a href="#valuespec">VALUE</a> </td> <td> - Disconnect after OFFSET bytes. + Set a header. + </td> + </tr> + + <tr> + <td> i<a href="#offsetspec">OFFSET</a>,<a href="#valuespec">VALUE</a> </td> + <td> + Inject the specified value at the offset. </td> </tr> diff --git a/libpathod/templates/index.html b/libpathod/templates/index.html index 3c1ba8ff..9561fee1 100644 --- a/libpathod/templates/index.html +++ b/libpathod/templates/index.html @@ -31,7 +31,7 @@ name="spec" class="input-medium search-query" value="{{spec}}" - placeholder="code[msg]:[features]" + placeholder="code:[features]" > <a id="gopublic" class="btn">go</a> </p> diff --git a/libpathod/templates/response_previewform.html b/libpathod/templates/response_previewform.html index 74e21362..7f72aaeb 100644 --- a/libpathod/templates/response_previewform.html +++ b/libpathod/templates/response_previewform.html @@ -5,7 +5,7 @@ name="spec" class="input-medium search-query" value="{{spec}}" - placeholder="code[msg]:[features]" + placeholder="code:[features]" > <input type="submit" class="btn" value="preview"> {% if not nocraft %} |