Skip to content

Commit

Permalink
Fix origin-checking logic in postMessage
Browse files Browse the repository at this point in the history
This allows us to post messages where the origin is something other than `*`. Closes #1789.
  • Loading branch information
jmlopez-rod authored and domenic committed Apr 24, 2017
1 parent 4513ba1 commit fa74ef9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/jsdom/living/post-message.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = function (message, targetOrigin) {

// TODO: targetOrigin === '/' - requires reference to source window
// See https://github.com/tmpvar/jsdom/pull/1140#issuecomment-111587499
if (targetOrigin !== "*" && targetOrigin !== this.origin) {
if (targetOrigin !== "*" && targetOrigin !== this.location.origin) {
return;
}

Expand Down

0 comments on commit fa74ef9

Please sign in to comment.