don't reauthenticate on HTTP 400 errors

since these are likely unrelated to authentication issues, but rather have to do with generic API errors or outages
This commit is contained in:
Martin Raifer
2025-02-11 16:28:42 +01:00
parent a83f5b3ff5
commit 121f3e2fb8
2 changed files with 9 additions and 11 deletions

View File

@@ -163,14 +163,14 @@ describe('iD.serviceOsm', function () {
});
});
it('retries an authenticated call unauthenticated if 400 Bad Request', function (done) {
it('retries an authenticated call unauthenticated if 401 Unauthorized', function (done) {
fetchMock.mock('https://www.openstreetmap.org' + path, {
body: response,
status: 200,
headers: { 'Content-Type': 'application/json' }
});
serverXHR.respondWith('GET', 'https://www.openstreetmap.org' + path,
[400, { 'Content-Type': 'text/plain' }, 'Bad Request']);
[401, { 'Content-Type': 'text/plain' }, 'Unauthorized']);
login();