Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  test_005_trailers.py

  Sprache: Python
 

import os
import pytest

from .env import H1Conf


# The trailer tests depend on "nghttp" as no other client seems to be able to send those
# rare things.
class TestTrailers:

    @pytest.fixture(autouse=True, scope='class')
    def _class_scope(self, env):
        H1Conf(env).add_vhost_cgi(proxy_self=True).install()
        assert env.apache_restart() == 0

    # check that we get a trailer out when telling the handler to add one
    def test_h1_005_01(self, env):
        if not env.httpd_is_at_least("2.5.0"):
            pytest.skip(f'need at least httpd 2.5.0 for this')
        url = env.mkurl("https""cgi""/h1test/echo")
        host = f"cgi.{env.http_tld}"
        fpath = os.path.join(env.gen_dir, "data-1k")
        r = env.curl_upload(url, fpath, options=["--header""Add-Trailer: 005_01"])
        assert r.exit_code == 0, f"{r}"
        assert 200 <= r.response["status"] < 300
        assert r.response["trailer"], f"no trailers received: {r}"
        assert "h1test-add-trailer" in r.response["trailer"]
        assert r.response["trailer"]["h1test-add-trailer"] == "005_01"

    # check that we get out trailers through the proxy
    def test_h1_005_02(self, env):
        if not env.httpd_is_at_least("2.5.0"):
            pytest.skip(f'need at least httpd 2.5.0 for this')
        url = env.mkurl("https""cgi""/proxy/h1test/echo")
        host = f"cgi.{env.http_tld}"
        fpath = os.path.join(env.gen_dir, "data-1k")
        r = env.curl_upload(url, fpath, options=["--header""Add-Trailer: 005_01"])
        assert r.exit_code == 0, f"{r}"
        assert 200 <= r.response["status"] < 300
        assert r.response["trailer"], f"no trailers received: {r}"
        assert "h1test-add-trailer" in r.response["trailer"]
        assert r.response["trailer"]["h1test-add-trailer"] == "005_01"

Messung V0.5 in Prozent
C=93 H=100 G=96

¤ Dauer der Verarbeitung: 0.13 Sekunden  (vorverarbeitet am  2026-06-13) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik