Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix reverse proxy #57

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Commits on Jan 9, 2018

  1. Configuration menu
    Copy the full SHA
    a6566ac View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    979710f View commit details
    Browse the repository at this point in the history

Commits on Jan 11, 2018

  1. Configuration menu
    Copy the full SHA
    4c37011 View commit details
    Browse the repository at this point in the history

Commits on Jan 13, 2018

  1. Return correct ajax responses in /save.

    Was a Typo: 'ContentType'.
    jamieforth committed Jan 13, 2018
    Configuration menu
    Copy the full SHA
    5a88b40 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    036a1c6 View commit details
    Browse the repository at this point in the history
  3. Insert experiment variables (csrf_token and SCRIPT_ROOT) template

    into experiment index.html on install.
    
    Previous solution of appending the template script after the html tag
    was unreliable.
    
    SCRIPT_ROOT is necessary for posting to experiment factory deployed
    behind a reverse proxy. Experiment must POST to SCRIPT_ROOT + '/save'.
    
    ```js
    on_finish: function(data) {
      // Get the data.
      var data = jsPsych.data.get();
    
      var request = $.post(
        SCRIPT_ROOT + '/save',
        {'data': data.json()},
        function() {
          // Success, go to /next.
          document.location = SCRIPT_ROOT + '/next';
        },
        'json')
          .fail(function() {
            // Error, local save.
            data.localSave('json', 'results.json');
            document.location = SCRIPT_ROOT + '/next';
          });
    }
    ```
    jamieforth committed Jan 13, 2018
    Configuration menu
    Copy the full SHA
    48dc90e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    52b41af View commit details
    Browse the repository at this point in the history