Skip to content

Commit

Permalink
fix(ui): Import > Postman > sophos api collection fails to import due…
Browse files Browse the repository at this point in the history
… to auth being null and a request also being null (resolves #309)
  • Loading branch information
flawiddsouza committed Feb 17, 2025
1 parent d38a4ae commit b3b67b9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/ui/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1784,7 +1784,7 @@ function convertRestfoxAuthToInsomniaAuth(auth: any) {
export function convertPostmanAuthToRestfoxAuth(request: any) {
let authentication: RequestAuthentication = { type: 'No Auth' }

if('auth' in request) {
if('auth' in request && request.auth) {
const authType = request.auth.type

if(authType === 'bearer' && request.auth.bearer) {
Expand Down
3 changes: 3 additions & 0 deletions packages/ui/src/parsers/postman.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ function handlePostmanV2CollectionItem(postmanCollectionItem: any, parentId: str
const plugins: Plugin[] = []

postmanCollectionItem.item.forEach((request: any) => {
if(!request) {
return
}
const requestId = request.id ?? nanoid()
if('item' in request) {
const { convertedRequests, plugins: newPlugins } = handlePostmanV2CollectionItem(request, requestId, workspaceId)
Expand Down

0 comments on commit b3b67b9

Please sign in to comment.