Kong / Kong/insomnia

Authorization Header not read when importing a Postman file

Open
#5,920 1 comment 1 reaction 0 assignees View on GitHub
B-bug PA-importers S-unverified
Dominant language
TypeScript
Stars
40k
Forks
2.4k
Avg merge
2d 13h
Merged PRs (30d)
61

Description

### Expected Behavior

When importing a Collection, headers named "Authorization" are ignored, instead of being added as a header or being added as an "API Key Auth" with `KEY: Authorization`, `VALUE: {{value}}` and `ADD TO: Header`

### Actual Behavior

The header is completely ignored. This is a problem when importing a large collection, as there is no way to edit the Authorization or Header of many requests simultaneously without the use of a plugin. See example below

### Reproduction Steps

1. Copy the following JSON schema (taken from a bigger collection found [here](https://schema.getpostman.com/json/collection/v2.0.0/collection.json)):
```json
{
"info": {
"name": "Mirakl seller API: mmp",
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
},
"variables": [],
"item": [
{
"name": "example",
"request": {
"method": "get",
"url": {
"raw": "{{URL}}/api/document-request/:document_request_id/lines",
"host": ["{{URL}}"],
"path": [
"",
"api",
"document-request",
":document_request_id",
"lines"
],
"variable": [{ "key": ":document_request_id", "value": "value" }],
"query": [{ "key": "shop_id", "value": "", "disabled": true }]
},
"header": [
{ "key": "Authorization", "value": "{{APIKEY}}" },
{ "key": "Accept", "value": "application/json" }
],
"body": {}
},
"response": []
}
]
}

```
2. go to Home on the Insomnia App
3. click on "Create" > "Import from Clipboard"
4. Select "Import as Request Collection"
5. Notice how the request has no Header corresponding to the "Authorization" key, as well as no Auth Key

### Is there an existing issue for this?

- [X] I have searched the [issue tracker](https://www.github.com/Kong/insomnia/issues) for this problem.

### Additional Information

_No response_

### Insomnia Version

2023.1.0

### What operating system are you using?

macOS

### Operating System Version

12.6.2

### Installation method

Website

### Last Known Working Insomnia version

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue through Home > Create > Import from Clipboard, then select Import as Request Collection with the supplied Postman JSON. Trace the Postman collection import path and verify that the Authorization entry is preserved as a header or API Key Auth while other headers still import correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
postman, typescript
Domain
api, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.