XTLS/Xray-core · error

unsupported padding method:

Error message

unsupported padding method: 

What it means

SplitHTTPConfig.Build() validates "xPaddingMethod" at transport_method.go:354-360. Empty defaults to "repeat-x"; only "repeat-x" and "tokenish" are accepted; any other value is appended to the error message.

Source

Thrown at infra/conf/transport_method.go:359

	if c.XPaddingHeader == "" {
		c.XPaddingHeader = "X-Padding"
	}

	switch c.XPaddingPlacement {
	case "":
		c.XPaddingPlacement = "queryInHeader"
	case "cookie", "header", "query", "queryInHeader":
	default:
		return nil, errors.New("unsupported padding placement: " + c.XPaddingPlacement)
	}

	switch c.XPaddingMethod {
	case "":
		c.XPaddingMethod = "repeat-x"
	case "repeat-x", "tokenish":
	default:
		return nil, errors.New("unsupported padding method: " + c.XPaddingMethod)
	}

	switch c.UplinkDataPlacement {
	case "":
		c.UplinkDataPlacement = splithttp.PlacementAuto
	case splithttp.PlacementAuto, splithttp.PlacementBody:
	case splithttp.PlacementCookie, splithttp.PlacementHeader:
		if c.Mode != "packet-up" {
			return nil, errors.New("UplinkDataPlacement can be " + c.UplinkDataPlacement + " only in packet-up mode")
		}
	default:
		return nil, errors.New("unsupported uplink data placement: " + c.UplinkDataPlacement)
	}

	if c.UplinkHTTPMethod == "" {
		c.UplinkHTTPMethod = "POST"
	}
	c.UplinkHTTPMethod = strings.ToUpper(c.UplinkHTTPMethod)

View on GitHub (pinned to 7d214f8b09)

Solutions

  1. Set "xPaddingMethod" to "repeat-x" or "tokenish"
  2. Omit the field to use the "repeat-x" default

Example fix

// before
"xPaddingMethod": "random"
// after
"xPaddingMethod": "repeat-x"
Defensive patterns

Strategy: type-guard

Type guard

func validXPaddingMethod(m string) bool {
	return m == "" || m == "repeat-x" || m == "tokenish"
}

Prevention

When it happens

Trigger: "xPaddingMethod": "random", "none", "repeatx", or any string other than the two supported padding methods in splithttp transportSettings.

Common situations: Assuming arbitrary padding algorithms exist; typos; configs generated for a different XHTTP fork with extra methods.

Related errors


AI-assisted analysis of XTLS/Xray-core@7d214f8b09 (2026-08-15). Data as JSON: /api/errors/309868a1e323a419. Report an issue: GitHub.