mirror of
				https://github.com/binwiederhier/ntfy.git
				synced 2025-10-30 12:32:12 +01:00 
			
		
		
		
	Merge branch 'main' of github.com:binwiederhier/ntfy into icons
This commit is contained in:
		
						commit
						ae1fb74ac6
					
				
					 26 changed files with 3233 additions and 2934 deletions
				
			
		|  | @ -124,7 +124,7 @@ func newRequestFromMatrixJSON(r *http.Request, baseURL string, messageLimit int) | |||
| 	} | ||||
| 	pushKey := m.Notification.Devices[0].PushKey // We ignore other devices for now, see discussion in #316 | ||||
| 	if !strings.HasPrefix(pushKey, baseURL+"/") { | ||||
| 		return nil, &errMatrix{pushKey: pushKey, err: errHTTPBadRequestMatrixPushkeyBaseURLMismatch} | ||||
| 		return nil, &errMatrix{pushKey: pushKey, err: wrapErrHTTP(errHTTPBadRequestMatrixPushkeyBaseURLMismatch, "received push key: %s, configured base URL: %s", pushKey, baseURL)} | ||||
| 	} | ||||
| 	newRequest, err := http.NewRequest(http.MethodPost, pushKey, io.NopCloser(bytes.NewReader(body.PeekedBytes))) | ||||
| 	if err != nil { | ||||
|  |  | |||
|  | @ -56,7 +56,7 @@ func TestMatrix_NewRequestFromMatrixJSON_MismatchingPushKey(t *testing.T) { | |||
| 	_, err := newRequestFromMatrixJSON(r, baseURL, maxLength) | ||||
| 	matrixErr, ok := err.(*errMatrix) | ||||
| 	require.True(t, ok) | ||||
| 	require.Equal(t, errHTTPBadRequestMatrixPushkeyBaseURLMismatch, matrixErr.err) | ||||
| 	require.Equal(t, "invalid request: push key must be prefixed with base URL, received push key: https://ntfy.example.com/upABCDEFGHI?up=1, configured base URL: https://ntfy.sh", matrixErr.err.Error()) | ||||
| 	require.Equal(t, "https://ntfy.example.com/upABCDEFGHI?up=1", matrixErr.pushKey) | ||||
| } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Philipp Heckel
						Philipp Heckel