Skip to content

Commit 67bb784

Browse files
committed
no sonar warnings added
1 parent 44e8d94 commit 67bb784

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

packages/http/httpx/tests/middleware_tests/test_redirect_handler.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -306,11 +306,11 @@ async def test_redirect_scheme_change_removes_auth_and_cookie():
306306
"""Test that scheme changes remove both Authorization and Cookie headers"""
307307

308308
def request_handler(request: httpx.Request):
309-
if request.url == "http://example.com/api":
309+
if request.url == "http://example.com/api": # NOSONAR
310310
return httpx.Response(200, )
311311
return httpx.Response(
312312
MOVED_PERMANENTLY,
313-
headers={LOCATION_HEADER: "http://example.com/api"},
313+
headers={LOCATION_HEADER: "http://example.com/api"}, # NOSONAR
314314
)
315315

316316
handler = RedirectHandler(RedirectHandlerOption(allow_redirect_on_scheme_change=True))
@@ -364,17 +364,17 @@ async def test_redirect_with_different_port_removes_auth_and_cookie():
364364
"""Test that redirects to a different port remove Authorization and Cookie headers"""
365365

366366
def request_handler(request: httpx.Request):
367-
if request.url == "http://example.org:9090/bar":
367+
if request.url == "http://example.org:9090/bar": # NOSONAR
368368
return httpx.Response(200, )
369369
return httpx.Response(
370370
MOVED_PERMANENTLY,
371-
headers={LOCATION_HEADER: "http://example.org:9090/bar"},
371+
headers={LOCATION_HEADER: "http://example.org:9090/bar"}, # NOSONAR
372372
)
373373

374374
handler = RedirectHandler()
375375
request = httpx.Request(
376376
'GET',
377-
"http://example.org:8080/foo",
377+
"http://example.org:8080/foo", # NOSONAR
378378
headers={
379379
AUTHORIZATION_HEADER: "Bearer token",
380380
"Cookie": "session=SECRET"
@@ -393,17 +393,17 @@ async def test_redirect_with_same_port_keeps_auth_and_cookie():
393393
"""Test that redirects to the same port keep Authorization and Cookie headers"""
394394

395395
def request_handler(request: httpx.Request):
396-
if request.url == "http://example.org:8080/bar":
396+
if request.url == "http://example.org:8080/bar": # NOSONAR
397397
return httpx.Response(200, )
398398
return httpx.Response(
399399
FOUND,
400-
headers={LOCATION_HEADER: "http://example.org:8080/bar"},
400+
headers={LOCATION_HEADER: "http://example.org:8080/bar"}, # NOSONAR
401401
)
402402

403403
handler = RedirectHandler()
404404
request = httpx.Request(
405405
'GET',
406-
"http://example.org:8080/foo",
406+
"http://example.org:8080/foo", # NOSONAR
407407
headers={
408408
AUTHORIZATION_HEADER: "Bearer token",
409409
"Cookie": "session=SECRET"
@@ -482,7 +482,7 @@ def test_default_scrub_sensitive_headers_removes_on_scheme_change():
482482
original_url = httpx.URL("https://example.com/v1/api")
483483
new_request = httpx.Request(
484484
"GET",
485-
"http://example.com/v1/api",
485+
"http://example.com/v1/api", # NOSONAR
486486
headers={
487487
AUTHORIZATION_HEADER: "Bearer token",
488488
"Cookie": "session=SECRET",
@@ -523,10 +523,10 @@ def test_default_scrub_sensitive_headers_removes_on_port_change():
523523
"""Test that default scrubber removes Authorization and Cookie when port changes"""
524524
from kiota_http.middleware.options.redirect_handler_option import default_scrub_sensitive_headers
525525

526-
original_url = httpx.URL("http://example.org:8080/foo")
526+
original_url = httpx.URL("http://example.org:8080/foo") # NOSONAR
527527
new_request = httpx.Request(
528528
"GET",
529-
"http://example.org:9090/bar",
529+
"http://example.org:9090/bar", # NOSONAR
530530
headers={
531531
AUTHORIZATION_HEADER: "Bearer token",
532532
"Cookie": "session=SECRET",
@@ -545,10 +545,10 @@ def test_default_scrub_sensitive_headers_keeps_on_same_port():
545545
"""Test that default scrubber keeps headers when port is the same"""
546546
from kiota_http.middleware.options.redirect_handler_option import default_scrub_sensitive_headers
547547

548-
original_url = httpx.URL("http://example.org:8080/foo")
548+
original_url = httpx.URL("http://example.org:8080/foo") # NOSONAR
549549
new_request = httpx.Request(
550550
"GET",
551-
"http://example.org:8080/bar",
551+
"http://example.org:8080/bar", # NOSONAR
552552
headers={
553553
AUTHORIZATION_HEADER: "Bearer token",
554554
"Cookie": "session=SECRET",

0 commit comments

Comments
 (0)