Import Anubis v1.28.2
Replace the tree with upstream TecharoHQ/anubis v1.28.2 (a1384fbf42e3). Masyunis customizations are re-applied in the following commits.
This commit is contained in:
1 parent
eb3e46d8d0
commit
e07de898cd
573 files changed
+35846
-6807
No files matched your search
@@ -0,0 +1,22 @@
|
||||
package internal
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
|
||||
"github.com/lum8rjack/go-ja4h"
|
||||
)
|
||||
|
||||
func TestJA4HReplacesClientFingerprint(t *testing.T) {
|
||||
r := httptest.NewRequest("GET", "http://example.com/", nil)
|
||||
r.Header.Add(JA4HHeaderName, "forged")
|
||||
r.Header.Add(JA4HHeaderName, "another forgery")
|
||||
want := ja4h.JA4H(r)
|
||||
JA4H(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
values := r.Header.Values(JA4HHeaderName)
|
||||
if len(values) != 1 || values[0] != want {
|
||||
t.Fatalf("fingerprint=%q want %q", values, want)
|
||||
}
|
||||
})).ServeHTTP(httptest.NewRecorder(), r)
|
||||
}
|
||||
Reference in new issue
Block a user