zowe / zowe/api-layer

API ML v2 doesn't return correct headers for CORS

Open
#4,518 0 comments 0 reactions 1 assignee View on GitHub

@balhar-jakub is already working on this.

Since Mar 25, 2026.

bug Priority: Medium size/XS
Dominant language
Java
Stars
92
Forks
81
Avg merge
1d 9h
Merged PRs (30d)
46

Description

Describe the bug
Websites accessed outside of the API ML domain would like to consume REST APIs via API ML. Gateway supports handling CORS on behalf of registered REST APIs, with the opt-in flag accompanied by the allowed origins header. API ML v3 returns the correct headers provided by the service during registration. API ML v2 is accepting the opt-in flag, allowes request to pass to the targeted REST API, but doesn't set the allowed origins header, leading to an error in the browser.

Steps to Reproduce

  1. Start API ML v2
  2. Register service with CORS enabled and allowed headers
  3. execute cross site request from another website to this service

Expected behavior
Proper headers are being returned, and the browser allows the cross-site request to continue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.