Skip to content

When using polling a failed request returns with a CORS error. #211

@nherment

Description

@nherment

Hi,

When doing a CORS polling request, if the request fails the verification (here), the browser does not show the error returned by engine.io but show a CORS error instead.

This makes troubleshooting very difficult.

I believe that this is happening because the CORS headers are added only when the request is recognized as xhr-polling.

The CORS headers are supposedly added during the handshake.

Steps to reproduce

2 domains: subA.domain.com subB.domain.com

// this request emerged from a webpage on subA.domain.com
$.get(
    'https://subB.domain.com/engine.io/?EIO=2&transport=polling&sid=thisSidIsNotValid'
  );
XMLHttpRequest cannot load https://subB.domain.com/engine.io/?EIO=2&transport=polling&sid=thisSidIsNotValid. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://subA.domain.com' is therefore not allowed access.

Not sure how easy it would be to fix this.

It's happening with engine.io 0.7.9 but after looking at the code I believe it should be reproducible on the current master branch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions