Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trailer checking #17

Closed
stanley101music opened this issue Dec 4, 2023 · 1 comment
Closed

Trailer checking #17

stanley101music opened this issue Dec 4, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@stanley101music
Copy link

Describe the bug
The checking for disallowed directives of Trailer is conflicting

To Reproduce
Steps to reproduce the behavior:

  1. For example, a header like Trailer: Authorization
  2. The output will not contain the result where the Trailer is using Authorization which is a disallowed directive

Expected behavior
Should have the result, Trailer (Disallowed Directives)

Additional context

if 'Trailer' in headers:
    trailer_h = headers['Trailer'].lower()
    if any(elem in trailer_h for elem in l_trailer):
        print_detail_r('[itrailer_h]', is_red=True)
        if not args.brief:
            matches_trailer = [x for x in l_trailer if x in trailer_h]
            print_detail_l("[itrailer_d_s]")
            print(', '.join(matches_trailer))
            print_detail("[itrailer_d_r]")
        i_cnt[0] += 1
l_trailer = ['Authorization', 'Cache-Control', 'Content-Encoding',
             'Content-Length', 'Content-Type', 'Content-Range', 'Host',
             'Max-Forwards', 'Set-Cookie', 'TE', 'Trailer',
             'Transfer-Encoding']

The any check goes through l_trailer which contains capital letters in every element while it uses .lower() to convert the actual value of Trailer. Therefore, the condition was never met.

@rfc-st rfc-st self-assigned this Dec 4, 2023
@rfc-st rfc-st added the bug Something isn't working label Dec 4, 2023
rfc-st added a commit that referenced this issue Dec 4, 2023
@rfc-st
Copy link
Owner

rfc-st commented Dec 4, 2023

Hi,

Good finding!. Fixed in 7d4282c

Thanks.

Regards,

@rfc-st rfc-st closed this as completed Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants