Skip to content

Commit a6ec3b6

Browse files
authored
XHTTP transport: Fix "auto" mode with REALITY (#5638)
Fixes #5635 BTW, fixes #5631
1 parent 20cf00c commit a6ec3b6

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

infra/conf/transport_internet.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ func (c *SplitHTTPConfig) Build() (proto.Message, error) {
314314
switch c.UplinkDataPlacement {
315315
case "":
316316
c.UplinkDataPlacement = "body"
317+
case "body":
317318
case "cookie", "header":
318319
if c.Mode != "packet-up" {
319320
return nil, errors.New("UplinkDataPlacement can be " + c.UplinkDataPlacement + " only in packet-up mode")
@@ -334,15 +335,15 @@ func (c *SplitHTTPConfig) Build() (proto.Message, error) {
334335
switch c.SessionPlacement {
335336
case "":
336337
c.SessionPlacement = "path"
337-
case "cookie", "header", "query":
338+
case "path", "cookie", "header", "query":
338339
default:
339340
return nil, errors.New("unsupported session placement: " + c.SessionPlacement)
340341
}
341342

342343
switch c.SeqPlacement {
343344
case "":
344345
c.SeqPlacement = "path"
345-
case "cookie", "header", "query":
346+
case "path", "cookie", "header", "query":
346347
if c.SessionPlacement == "path" {
347348
return nil, errors.New("SeqPlacement must be path when SessionPlacement is path")
348349
}

transport/internet/splithttp/dialer.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -272,11 +272,6 @@ func Dial(ctx context.Context, dest net.Destination, streamSettings *internet.Me
272272
requestURL.Host = dest.Address.String()
273273
}
274274

275-
sessionId := ""
276-
if transportConfiguration.Mode != "stream-one" {
277-
sessionIdUuid := uuid.New()
278-
sessionId = sessionIdUuid.String()
279-
}
280275
requestURL.Path = transportConfiguration.GetNormalizedPath()
281276
requestURL.RawQuery = transportConfiguration.GetNormalizedQuery()
282277

@@ -293,6 +288,12 @@ func Dial(ctx context.Context, dest net.Destination, streamSettings *internet.Me
293288
}
294289
}
295290

291+
sessionId := ""
292+
if mode != "stream-one" {
293+
sessionIdUuid := uuid.New()
294+
sessionId = sessionIdUuid.String()
295+
}
296+
296297
errors.LogInfo(ctx, fmt.Sprintf("XHTTP is dialing to %s, mode %s, HTTP version %s, host %s", dest, mode, httpVersion, requestURL.Host))
297298

298299
requestURL2 := requestURL

0 commit comments

Comments
 (0)