-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SplitHTTP: More range options, change defaults, enforce maxUploadSize…
…, fix querystring behavior (#3603) * maxUploadSize and maxConcurrentUploads can now be ranges on the client * maxUploadSize is now enforced on the server * the default of maxUploadSize is 2MB on the server, and 1MB on the client * the default of maxConcurrentUploads is 200 on the server, and 100 on the client * ranges on the server are treated as a single number. if server is configured as `"1-2"`, server will enforce `2` * querystrings in `path` are now handled correctly
- Loading branch information
Showing
8 changed files
with
223 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package splithttp_test | ||
|
||
import ( | ||
"testing" | ||
|
||
. "github.com/xtls/xray-core/transport/internet/splithttp" | ||
) | ||
|
||
func Test_GetNormalizedPath(t *testing.T) { | ||
c := Config{ | ||
Path: "/?world", | ||
} | ||
|
||
path := c.GetNormalizedPath("hello", true) | ||
if path != "/hello?world" { | ||
t.Error("Unexpected: ", path) | ||
} | ||
} | ||
|
||
func Test_GetNormalizedPath2(t *testing.T) { | ||
c := Config{ | ||
Path: "?world", | ||
} | ||
|
||
path := c.GetNormalizedPath("hello", true) | ||
if path != "/hello?world" { | ||
t.Error("Unexpected: ", path) | ||
} | ||
} | ||
|
||
func Test_GetNormalizedPath3(t *testing.T) { | ||
c := Config{ | ||
Path: "hello?world", | ||
} | ||
|
||
path := c.GetNormalizedPath("", true) | ||
if path != "/hello/?world" { | ||
t.Error("Unexpected: ", path) | ||
} | ||
} | ||
|
||
func Test_GetNormalizedPath4(t *testing.T) { | ||
c := Config{ | ||
Path: "hello?world", | ||
} | ||
|
||
path := c.GetNormalizedPath("", false) | ||
if path != "/hello/" { | ||
t.Error("Unexpected: ", path) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.