Skip to content

Conversation

@ialloyd
Copy link
Contributor

@ialloyd ialloyd commented Mar 14, 2024

This PR fixes a bug that caused environment import to fail if the name contained a /. The importPostmanEnvironment function now replaces / with _ in environment names, allowing successful import.

@end3rbyte
Copy link
Contributor

This PR fix the bug #1761

Could it be merged please?

};

const importPostmanEnvironment = (environment) => {
const sanitizedEnvironmentName = environment.name.replace(/\//g, '_');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not work for Some / Environment / Name as it'll result in Some _ Environment / Name, also there are more forbidden characters.

Any character that makes an invalid file name will throw an exception (/ for Windows, but Unix-based systems have more symbols).

@maintainer-bruno maintainer-bruno added the triaged Preliminary analysis completed label Jun 3, 2025
@Pragadesh44-Bruno Pragadesh44-Bruno changed the title [Bug] Using a / in an Environment Name causes error #1761 [Bug] Using a / in an Environment Name causes error in Postman Import #1761 Jun 4, 2025
@Pragadesh44-Bruno
Copy link
Collaborator

Hey @ialloyd , thank you for raising this PR. In our latest versions, we have fixed the same bug you mentioned. If there are any invalid characters in the environment filename, they will be replaced with a “-”.
Thanks for the contribution!

Recording.at.2025-06-04.21.47.23.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can-be-closed size/XS triaged Preliminary analysis completed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants