XTLS/Xray-core · error

too big http 1xx response

Error message

too big http 1xx response

What it means

Guard in readResponseAndHandle100Continue: the accumulated 1xx response header bytes exceeded the allowed size limit, indicating an abusive or broken upstream sending an oversized informational response.

Solutions

  1. Fix the upstream server to send compact 1xx headers
  2. Reject/drop the connection if headers exceed the limit
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at proxy/http/server.go:339 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at proxy/http/server.go:339

	if err == nil || err == bufio.ErrBufferFull {
		str := string(peekBytes)
		ResponseLine := strings.Split(str, "\r\n")[0]
		_, status, _ := strings.Cut(ResponseLine, " ")
		// only handle 1xx response
		if strings.HasPrefix(status, "1") {
			ResponseHeader1xx := []byte{}
			// read until \r\n\r\n (end of http response header)
			for {
				data, err := r.ReadSlice('\n')
				if err != nil {
					return nil, errors.New("failed to read http 1xx response").Base(err)
				}
				ResponseHeader1xx = append(ResponseHeader1xx, data...)
				if bytes.Equal(ResponseHeader1xx[len(ResponseHeader1xx)-4:], []byte{'\r', '\n', '\r', '\n'}) {
					break
				}
				if len(ResponseHeader1xx) > 1024 {
					return nil, errors.New("too big http 1xx response")
				}
			}
			writer.Write(ResponseHeader1xx)
		}
	}
	return http.ReadResponse(r, req)
}

func init() {
	common.Must(common.RegisterConfig((*ServerConfig)(nil), func(ctx context.Context, config interface{}) (interface{}, error) {
		return NewServer(ctx, config.(*ServerConfig))
	}))
}

View on GitHub (pinned to 7d214f8b09)