Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Calypso Origins: Add my.woo.ai and my.woo.localhost to known origins.
2 changes: 2 additions & 0 deletions projects/packages/jetpack-mu-wpcom/src/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ function wpcom_get_calypso_origin() {
'https://wordpress.com',
'http://my.localhost:3000',
'https://my.wordpress.com',
'http://my.woo.localhost:3000',
'https://my.woo.ai',
Comment on lines +92 to +93
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

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

Consider adding unit tests for the wpcom_get_calypso_origin function to verify that the new origins are properly recognized and that invalid origins are correctly rejected. This would help prevent regressions if the allowlist is modified in the future.

Copilot uses AI. Check for mistakes.
Comment on lines +92 to +93
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

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

The wpcom_get_calypso_origin() function validates origins for security purposes but lacks test coverage. Consider adding unit tests to verify that:

  • Only allowed origins are accepted
  • Disallowed origins fall back to the default 'https://wordpress.com'
  • The strict comparison in in_array() works correctly

This would help prevent regressions when adding or modifying allowed origins.

Copilot uses AI. Check for mistakes.
);
return in_array( $origin, $allowed, true ) ? $origin : 'https://wordpress.com';
}
Expand Down