[GH-ISSUE #3750] [bug]: Import collections from OpenAPI URL blocked by CORS #1302

Open
opened 2026-03-16 19:45:24 +03:00 by kerem · 0 comments
Owner

Originally created by @sky96111 on GitHub (Jan 16, 2024).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/3750

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

When I importing collections from OpenAPI url, it failed to import.
Console outputs:

hoppscotch.io/:1 Access to XMLHttpRequest at 'https://xxx/api/api.json' from origin 'https://hoppscotch.io' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
UrlImport.vue:90 ci {message: 'Network Error', name: 'AxiosError', code: 'ERR_NETWORK', config: {…}, request: XMLHttpRequest, …}
UrlImport.vue:68 
        
        
       GET https://xxx/api/api.json net::ERR_FAILED 200 (OK)
(anonymous) @ trycatch.js:167
(anonymous) @ xhr.js:135
(anonymous) @ xhr.js:258
xhr @ xhr.js:49
Zhe @ dispatchRequest.js:49
request @ Axios.js:146
xA.<computed> @ Axios.js:172
(anonymous) @ bind.js:5
g @ UrlImport.vue:68
v @ UrlImport.vue:83
ng @ runtime-core.esm-bundler.js:158
Ac @ runtime-core.esm-bundler.js:166
n @ runtime-dom.esm-bundler.js:595
i @ helpers.js:90
Show 12 more frames
Show less

Possible solution:

  • Move import url request into browser extension/tauri native method

Steps to reproduce

  1. Install hoppscotch pwa with browser extension/tauri client
  2. import collections from OpenAPI url

Environment

Release

Version

Cloud

Originally created by @sky96111 on GitHub (Jan 16, 2024). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/3750 ### Is there an existing issue for this? - [X] I have searched the existing issues ### Current behavior When I importing collections from OpenAPI url, it failed to import. Console outputs: ``` hoppscotch.io/:1 Access to XMLHttpRequest at 'https://xxx/api/api.json' from origin 'https://hoppscotch.io' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. UrlImport.vue:90 ci {message: 'Network Error', name: 'AxiosError', code: 'ERR_NETWORK', config: {…}, request: XMLHttpRequest, …} UrlImport.vue:68 GET https://xxx/api/api.json net::ERR_FAILED 200 (OK) (anonymous) @ trycatch.js:167 (anonymous) @ xhr.js:135 (anonymous) @ xhr.js:258 xhr @ xhr.js:49 Zhe @ dispatchRequest.js:49 request @ Axios.js:146 xA.<computed> @ Axios.js:172 (anonymous) @ bind.js:5 g @ UrlImport.vue:68 v @ UrlImport.vue:83 ng @ runtime-core.esm-bundler.js:158 Ac @ runtime-core.esm-bundler.js:166 n @ runtime-dom.esm-bundler.js:595 i @ helpers.js:90 Show 12 more frames Show less ``` Possible solution: - Move import url request into browser extension/tauri native method ### Steps to reproduce 1. Install hoppscotch pwa with browser extension/tauri client 2. import collections from OpenAPI url ### Environment Release ### Version Cloud
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#1302
No description provided.