mirror of
https://github.com/howmp/reality
synced 2025-02-23 18:52:16 +08:00
fix config data place holder #2
This commit is contained in:
parent
fd6cfca2db
commit
b29f81307d
@ -148,8 +148,7 @@ func loadConfig(path string) (*reality.ServerConfig, error) {
|
|||||||
|
|
||||||
func replaceClientTemplate(template []byte, configData []byte) ([]byte, error) {
|
func replaceClientTemplate(template []byte, configData []byte) ([]byte, error) {
|
||||||
placeholder := make([]byte, len(cmd.ConfigDataPlaceholder))
|
placeholder := make([]byte, len(cmd.ConfigDataPlaceholder))
|
||||||
placeholder[0] = 0xff
|
copy(placeholder, []byte{0xff, 0xff, 'g', 'r', 's', 'c', 'o', 'n', 'f', 'i', 'g'})
|
||||||
placeholder[1] = 0xff
|
|
||||||
pos := bytes.Index(template, placeholder)
|
pos := bytes.Index(template, placeholder)
|
||||||
if pos == -1 {
|
if pos == -1 {
|
||||||
return nil, errors.New("config placeholder not found")
|
return nil, errors.New("config placeholder not found")
|
||||||
|
Loading…
Reference in New Issue
Block a user