Modify ↓
Ticket #6873 (closed bug: duplicate)
Incorrect cross-site XHR detecting
| Reported by: | oryol | Owned by: | |
|---|---|---|---|
| Priority: | undecided | Milestone: | 1.4.3 |
| Component: | ajax | Version: | 1.4.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
Following code may work incorrect for default (80) http port: var parts = rurl.exec( s.url ),
remote = parts && (parts[1] && parts[1] !== location.protocol parts[2] !== location.host);
For example IE9 (Preview 4) returns default port in window.location.host (for example - 'localhost:80'). Even more - if we send XHR to ' http://some-host:80/some-path', then jQuery will detect it as remote query (which is wrong).
We need to check for both hosts (parts[2] and location.host) that them contains (or not) port. If not - add default 80.
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.
