| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -187,7 +187,8 @@ jobs: | |||
| 187 | 187 | fetch-depth: 0 | |
| 188 | 188 | ref: ${{ github.ref }} | |
| 189 | 189 | ||
| 190 | - - env: | ||
| 190 | + - name: Switch to the head branch | ||
| 191 | + env: | ||
| 191 | 192 | BRANCH: ${{ github.head_ref || github.ref_name }} | |
| 192 | 193 | run: git switch -C "$BRANCH" | |
| 193 | 194 | ||
@@ -221,7 +222,8 @@ jobs: | |||
| 221 | 222 | fetch-depth: 0 | |
| 222 | 223 | ref: ${{ github.ref }} | |
| 223 | 224 | ||
| 224 | - - env: | ||
| 225 | + - name: Switch to the head branch | ||
| 226 | + env: | ||
| 225 | 227 | BRANCH: ${{ github.ref_name }} | |
| 226 | 228 | run: git switch -C "$BRANCH" | |
| 227 | 229 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -106,6 +106,8 @@ def entry_to_string(self, hdr: str, other: bytes | str | None) -> str: | |||
| 106 | 106 | ||
| 107 | 107 | ||
| 108 | 108 | class DNSQuestion(DNSEntry): | |
| 109 | + """A question a resolver asks about a name.""" | ||
| 110 | + | ||
| 109 | 111 | __slots__ = ("_hash",) | |
| 110 | 112 | ||
| 111 | 113 | def __init__(self, name: str, type_: int, class_: int) -> None: | |
@@ -232,6 +234,8 @@ def to_string(self, other: bytes | str) -> str: | |||
| 232 | 234 | ||
| 233 | 235 | ||
| 234 | 236 | class DNSAddress(DNSRecord): | |
| 237 | + """Record holding an IPv4 or IPv6 address.""" | ||
| 238 | + | ||
| 235 | 239 | __slots__ = ("_hash", "address", "scope_id") | |
| 236 | 240 | ||
| 237 | 241 | def __init__( | |
@@ -338,6 +342,8 @@ def __repr__(self) -> str: | |||
| 338 | 342 | ||
| 339 | 343 | ||
| 340 | 344 | class DNSPointer(DNSRecord): | |
| 345 | + """PTR record naming a service instance.""" | ||
| 346 | + | ||
| 341 | 347 | __slots__ = ("_hash", "alias", "alias_key") | |
| 342 | 348 | ||
| 343 | 349 | def __init__( | |
@@ -389,6 +395,8 @@ def __repr__(self) -> str: | |||
| 389 | 395 | ||
| 390 | 396 | ||
| 391 | 397 | class DNSText(DNSRecord): | |
| 398 | + """TXT record carrying the service properties.""" | ||
| 399 | + | ||
| 392 | 400 | __slots__ = ("_hash", "text") | |
| 393 | 401 | ||
| 394 | 402 | def __init__( | |
@@ -431,6 +439,8 @@ def __repr__(self) -> str: | |||
| 431 | 439 | ||
| 432 | 440 | ||
| 433 | 441 | class DNSService(DNSRecord): | |
| 442 | + """SRV record with the target host, port, priority and weight.""" | ||
| 443 | + | ||
| 434 | 444 | __slots__ = ("_hash", "port", "priority", "server", "server_key", "weight") | |
| 435 | 445 | ||
| 436 | 446 | def __init__( | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -29,6 +29,16 @@ def teardown_module(): | |||
| 29 | 29 | ||
| 30 | 30 | ||
| 31 | 31 | class Names(unittest.TestCase): | |
| 32 | + def test_long_name(self): | ||
| 33 | + generated = r.DNSOutgoing(const._FLAGS_QR_RESPONSE) | ||
| 34 | + question = r.DNSQuestion( | ||
| 35 | + "an.excessively.deep.chain.of.dns.labels.used.for.testing.local.", | ||
| 36 | + const._TYPE_SRV, | ||
| 37 | + const._CLASS_IN, | ||
| 38 | + ) | ||
| 39 | + generated.add_question(question) | ||
| 40 | + r.DNSIncoming(generated.packets()[0]) | ||
| 41 | + | ||
| 32 | 42 | def test_exceedingly_long_name(self): | |
| 33 | 43 | generated = r.DNSOutgoing(const._FLAGS_QR_RESPONSE) | |
| 34 | 44 | name = f"{'part.' * 1000}local." | |
| Back | FazBrowse Home | New Git URL |
0 commit comments