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

Make normalizeHeaderKey optional #57

Closed
djannot opened this Issue Feb 24, 2016 · 4 comments

Comments

Projects
None yet
2 participants
@djannot
Contributor

djannot commented Feb 24, 2016

Could you please make this function optional ?

Even if headers are supposed to be case-insensitive, many applications aren't working correctly when they header case isn't the one they were expecting. I want to build a reverse proxy based on fasthttp and need it to be compatible with any application.

@valyala valyala added the enhancement label Feb 25, 2016

@valyala

This comment has been minimized.

Show comment
Hide comment
@valyala

valyala Feb 25, 2016

Owner

@djannot , thanks for the feature request. I'll look into it.

Owner

valyala commented Feb 25, 2016

@djannot , thanks for the feature request. I'll look into it.

@valyala

This comment has been minimized.

Show comment
Hide comment
@valyala

valyala Feb 25, 2016

Owner

Done - see DisableHeaderNamesNormalizing flag inside Server.

Owner

valyala commented Feb 25, 2016

Done - see DisableHeaderNamesNormalizing flag inside Server.

@djannot

This comment has been minimized.

Show comment
Hide comment
@djannot

djannot Feb 27, 2016

Contributor

I've tried to use the new feature this way:

c := &fasthttp.HostClient{
        Addr: "10.64.231.196:9020",
    }

  response := fasthttp.AcquireResponse()
  response.Header.DisableNormalizing()

  err := c.DoTimeout(&ctx.Request, response, time.Second * 3600)
    if err != nil {
        log.Printf("Error: %s", err)
    }
  fmt.Println(response.Header.String())

But response headers are normalized.

Did I make something wrong ?

Contributor

djannot commented Feb 27, 2016

I've tried to use the new feature this way:

c := &fasthttp.HostClient{
        Addr: "10.64.231.196:9020",
    }

  response := fasthttp.AcquireResponse()
  response.Header.DisableNormalizing()

  err := c.DoTimeout(&ctx.Request, response, time.Second * 3600)
    if err != nil {
        log.Printf("Error: %s", err)
    }
  fmt.Println(response.Header.String())

But response headers are normalized.

Did I make something wrong ?

@valyala valyala reopened this Feb 29, 2016

valyala added a commit that referenced this issue Feb 29, 2016

Issue #57: Added DisableHeaderNamesNormalizing config option to Clien…
…t and HostClient to be consistent with the corresponding option in Server
@valyala

This comment has been minimized.

Show comment
Hide comment
@valyala

valyala Feb 29, 2016

Owner

The feature wan't implemented for the HostClient :)

Just added DisableHeaderNamesNormalizing option to Client and HostClient in e252d37 . See the corresponding test in the commit for details.

Owner

valyala commented Feb 29, 2016

The feature wan't implemented for the HostClient :)

Just added DisableHeaderNamesNormalizing option to Client and HostClient in e252d37 . See the corresponding test in the commit for details.

@valyala valyala closed this Feb 29, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment