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

Make normalizeHeaderKey optional #57

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

Make normalizeHeaderKey optional #57

djannot opened this issue Feb 24, 2016 · 4 comments

Comments

@djannot
Copy link
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
Copy link
Owner

valyala commented Feb 25, 2016

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

@valyala
Copy link
Owner

valyala commented Feb 25, 2016

Done - see DisableHeaderNamesNormalizing flag inside Server.

@djannot
Copy link
Contributor Author

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
…t and HostClient to be consistent with the corresponding option in Server
@valyala
Copy link
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.

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

No branches or pull requests

2 participants