mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-25 13:45:52 +00:00
chore(#1667): graceful handling of none type for backward compatibility
This commit is contained in:
@@ -31,12 +31,19 @@ const prepareRequest = (request, collectionRoot) => {
|
||||
headers: headers
|
||||
};
|
||||
|
||||
// Authentication
|
||||
// A request can override the collection auth with another auth
|
||||
// But it cannot override the collection auth with no auth
|
||||
// We will provide support for disabling the auth via scripting in the future
|
||||
/**
|
||||
* 27 Feb 2024:
|
||||
* ['inherit', 'none'].includes(request.auth.mode)
|
||||
* We are mainitaining the old behavior where 'none' used to inherit the collection auth.
|
||||
*
|
||||
* Very soon, 'none' will be treated as no auth and 'inherit' will be the only way to inherit collection auth.
|
||||
* We will request users to update their collection files to use 'inherit' instead of 'none'.
|
||||
* Don't want to break ongoing CI pipelines.
|
||||
*
|
||||
* Hoping to remove this by 1 April 2024.
|
||||
*/
|
||||
const collectionAuth = get(collectionRoot, 'request.auth');
|
||||
if (collectionAuth && request.auth.mode == 'inherit') {
|
||||
if (collectionAuth && ['inherit', 'none'].includes(request.auth.mode)) {
|
||||
if (collectionAuth.mode === 'basic') {
|
||||
axiosRequest.auth = {
|
||||
username: get(collectionAuth, 'basic.username'),
|
||||
|
||||
Reference in New Issue
Block a user