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

Improve HTTP usage in update_positions #2528

Merged
merged 3 commits into from
Jan 30, 2018

Conversation

jhawthorn
Copy link
Contributor

@jhawthorn jhawthorn commented Jan 24, 2018

This fixes some mildly bad HTTP behaviour that didn't really affect anything, but we might as well do it more properly.

  • We were responding with Content-Type: text/javascript with a body of "Ok". "Ok" is not valid JSON 🚫
  • OptionTypesController#update_values_positions had an unused format.html response, which didn't work.
  • We were doing ajax with dataType: 'script' (ie. get some javascript and eval it), which isn't actually what we wanted.

Previously we were returning "Ok", but with Content-Type:
text/javascript.
This endpoint doesn't take a product_id, so this URL doesn't generate
correctly. It also is only ever requested as JS.
@jhawthorn
Copy link
Contributor Author

I've spotted an InvalidAuthenticityToken issue with this on some pages.

@jhawthorn jhawthorn added the WIP label Jan 26, 2018
@jhawthorn
Copy link
Contributor Author

I've spotted an InvalidAuthenticityToken issue with this on some pages.

User error (mine)! Everything's good I had customized something else in my sandbox which was breaking this.

@jhawthorn jhawthorn removed the WIP label Jan 30, 2018
@jhawthorn jhawthorn merged commit 068c0f5 into solidusio:master Jan 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants