Skip to content

[wasm] fix SendAsync_GetWithInvalidHostHeader_ThrowsException - doesn't throw on WASM #53874

Closed

Description

@pavelsavara

System.Net.Http.Functional.Tests.SocketsHttpHandlerTest_HttpClientHandlerTest_Headers_Http11.SendAsync_GetWithInvalidHostHeader_ThrowsException on WASM in browser expects HttpRequestMessage.Headers.Host validation.

Assert.Throws() Failure
Expected: typeof(System.Net.Http.HttpRequestException)\nActual:   (No exception was thrown)]]
   at System.Net.Http.Functional.Tests.HttpClientHandlerTest_Headers.SendAsync_GetWithInvalidHostHeader_ThrowsException()

Activity

  1. ghost added
    untriaged
    on Jun 8, 2021
  2. added a commit that references this issue on Jun 8, 2021
  3. added this to the 6.0.0 milestone on Jun 8, 2021
  4. lewing commented on Jun 8, 2021

    @lewing
    Member

    I'm not sure how serious this one is, it looks like we're missing validation on an invalid header and we might end up pulling in a lot of code to do that validation, but someone should take a look.

  5. removed
    untriaged
    on Jun 8, 2021
  6. modified the milestones: 6.0.0, 7.0.0 on Aug 8, 2021
  7. ilonatommy commented on Jun 16, 2022

    @ilonatommy
    Member

    @pavelsavara, what do you think about @lewing's hypothesis?

  8. pavelsavara commented on Jun 16, 2022

    @pavelsavara
    MemberAuthor

    Perhaps it's not that bad ?

    if ((value != null) && (HttpRuleParser.GetHostLength(value, 0, false) != value.Length))

    internal static int GetHostLength(string input, int startIndex, bool allowToken)

  9. ghost added
    in-pr
    on Jul 11, 2022
  10. ghost removed
    in-pr
    on Jul 11, 2022
  11. ghost locked as resolved and limited conversation to collaborators on Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

arch-wasmarea-System.Net.Http

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions