mirror of
https://github.com/binwiederhier/ntfy.git
synced 2025-04-05 06:07:34 +03:00
Merge branch 'main' into vrate
This commit is contained in:
commit
ede957973b
4 changed files with 63 additions and 3 deletions
|
@ -796,6 +796,25 @@ func TestServer_Auth_ViaQuery(t *testing.T) {
|
|||
require.Equal(t, 401, response.Code)
|
||||
}
|
||||
|
||||
func TestServer_Auth_NonBasicHeader(t *testing.T) {
|
||||
s := newTestServer(t, newTestConfigWithAuthFile(t))
|
||||
|
||||
response := request(t, s, "PUT", "/mytopic", "test", map[string]string{
|
||||
"Authorization": "WebPush not-supported",
|
||||
})
|
||||
require.Equal(t, 200, response.Code)
|
||||
|
||||
response = request(t, s, "PUT", "/mytopic", "test", map[string]string{
|
||||
"Authorization": "Bearer supported",
|
||||
})
|
||||
require.Equal(t, 401, response.Code)
|
||||
|
||||
response = request(t, s, "PUT", "/mytopic", "test", map[string]string{
|
||||
"Authorization": "basic supported",
|
||||
})
|
||||
require.Equal(t, 401, response.Code)
|
||||
}
|
||||
|
||||
func TestServer_StatsResetter(t *testing.T) {
|
||||
// This tests the stats resetter for
|
||||
// - an anonymous user
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue