1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-10 09:50:43 +00:00

padding must be enabled when chunk masking is enabled

This commit is contained in:
Darien Raymond 2018-07-30 09:49:00 +02:00
parent 3b0bfe9422
commit bf2d3890de
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -87,10 +87,6 @@ func (v *Handler) Process(ctx context.Context, link *core.Link, dialer proxy.Dia
Option: protocol.RequestOptionChunkStream,
}
if enablePadding {
request.Option.Set(protocol.RequestOptionGlobalPadding)
}
rawAccount, err := request.User.GetTypedAccount()
if err != nil {
return newError("failed to get user account").Base(err).AtWarning()
@ -102,6 +98,10 @@ func (v *Handler) Process(ctx context.Context, link *core.Link, dialer proxy.Dia
request.Option.Set(protocol.RequestOptionChunkMasking)
}
if enablePadding && request.Option.Has(protocol.RequestOptionChunkMasking) {
request.Option.Set(protocol.RequestOptionGlobalPadding)
}
input := link.Reader
output := link.Writer