GithubHelp home page GithubHelp logo

Comments (5)

borski avatar borski commented on July 21, 2024

I have this same issue. nickelser: Can you be more specific as to how you got around this?

from pusher-js.

nickelser avatar nickelser commented on July 21, 2024

make sure you are including the csrf_meta_tags helper in your view, run the Pusher.csrf_token = $... code in some global init block, and then run setrequestheader in the ajaxsetup call.

in coffeescript, I have a function like this:

init_csrf = ->
  window._settings.token = $('meta[name="csrf-token"]').attr 'content'

  $.ajaxSetup
    beforeSend: (xhr) ->
      xhr.setRequestHeader "X-CSRF-Token", _settings.token

from pusher-js.

ThisIsMissEm avatar ThisIsMissEm commented on July 21, 2024

This isn't actually yet done, I'm working on a patch this week which should be released in the next couple of weeks.

from pusher-js.

brumm avatar brumm commented on July 21, 2024

I'm having this problem as well, and it's been a while - Any progress on this?

from pusher-js.

leggetter avatar leggetter commented on July 21, 2024

It's possible to pass additional parameters to be passed along with channel_name and socket_id by passing additional options to the Pusher constructor. This provides a way of defining additional query parameters and headers.

You can read the documentation here:
http://pusher.com/docs/client_api_guide/client_connect#options_parameter

from pusher-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.