doc: markup curl as program role

See ¹.

¹: https://www.sphinx-doc.org/en/1.5/markup/inline.html#role-program

Co-authored-by: Roberto Abdelkader Martínez Pérez <robertomartinezp@gmail.com>
This commit is contained in:
pancho horrillo
2019-12-11 11:26:37 +01:00
parent 3bed9924d5
commit 4d2f0af941
3 changed files with 9 additions and 9 deletions
+7 -7
View File
@@ -203,7 +203,7 @@ In this example we'll be adding the header ``X-Content-Type-Options`` to the res
$ kapow server nosniff.pow $ kapow server nosniff.pow
Testing with curl: Testing with :program:`curl`:
.. code-block:: console .. code-block:: console
:emphasize-lines: 11 :emphasize-lines: 11
@@ -263,7 +263,7 @@ date, then our ``pow`` file will fix it and return the correct value to the user
kapow get /request/body | jq --arg newdate "$(date +'%Y-%m-%d_%H-%M-%S')" '.incorrectDate=$newdate' | kapow set /response/body kapow get /request/body | jq --arg newdate "$(date +'%Y-%m-%d_%H-%M-%S')" '.incorrectDate=$newdate' | kapow set /response/body
EOF EOF
Call the service with ``curl``: Call the service with :program:`curl`:
.. code-block:: console .. code-block:: console
:linenos: :linenos:
@@ -291,7 +291,7 @@ order to generate a two-attribute JSON response.
jq --arg greet Hello --arg value "${JSON_WHO:-World}" --null-input '{ greet: $greet, to: $value }' | kapow set /response/body jq --arg greet Hello --arg value "${JSON_WHO:-World}" --null-input '{ greet: $greet, to: $value }' | kapow set /response/body
EOF EOF
Call the service with ``curl``: Call the service with :program:`curl`:
.. code-block:: console .. code-block:: console
:linenos: :linenos:
@@ -378,7 +378,7 @@ In this example, an attacker can inject arbitrary parameters to ``ls``.
ls $(kapow get /request/matches/value) | kapow set /response/body ls $(kapow get /request/matches/value) | kapow set /response/body
EOF EOF
Exploiting using curl: Exploiting using :program:`curl`:
.. code-block:: console .. code-block:: console
:linenos: :linenos:
@@ -421,7 +421,7 @@ You can specify custom status code for HTTP response:
echo -n '401 error' | kapow set /response/body echo -n '401 error' | kapow set /response/body
EOF EOF
Testing with ``curl``: Testing with :program:`curl`:
.. code-block:: console .. code-block:: console
:emphasize-lines: 10 :emphasize-lines: 10
@@ -495,7 +495,7 @@ params:
wait wait
EOF EOF
Calling with ``curl``: Calling with :program:`curl`:
.. code-block:: console .. code-block:: console
:linenos: :linenos:
@@ -525,7 +525,7 @@ In the next example we'll set a cookie:
echo -n OK | kapow set /response/body echo -n OK | kapow set /response/body
EOF EOF
Calling with ``curl``: Calling with :program:`curl`:
.. code-block:: console .. code-block:: console
:linenos: :linenos:
+1 -1
View File
@@ -150,7 +150,7 @@ Consume the Service
+++++++++++++++++++ +++++++++++++++++++
Now we can call our newly created endpoint by using our favorite HTTP client. Now we can call our newly created endpoint by using our favorite HTTP client.
In this example we're using ``curl``: In this example we're using :program:`curl`:
.. code-block:: console .. code-block:: console
+1 -1
View File
@@ -172,7 +172,7 @@ Backup that Database!
That appears to be the case, but we better check it. That appears to be the case, but we better check it.
Call it with ``curl``: Call it with :program:`curl`:
.. code-block:: console .. code-block:: console