* Rename FastlyHeaders to CachingHeaders, conditionally experiment with removing no-cache
We suspect that it is safe to remove `no-cache` entirely from the Cache-Control headers that are sent
along to Fastly, but there is no great way to confirm this hypothesis. We're testing this by experimenting
on one single article. We will conditionally default to the same headers that we send to Nginx, and send
those headers to Fastly (by removing `no-cache` and adding in `max-age`, which should be ignored since Fastly
also has Surrogate-Control headers added to it, which include a `max-age`, which Fastly should prioritize
over any other `max-age`.
Once we've confirmed that this doesn't cause issues on the Fastly side, we can remove this check and use
the same Cache-Control headers for both Fastly and Nginx.
* Add check for request.env[REQUEST_PATH].present?
* TagsController inherits from ApiController
* Let ApiController inherit from ActionController::Base to have its own lifecycle
* Remove unused method
* Use only one respond_to :json for the entire API
* ApiController inherits from ActionController::Base
* Use Pundit only where needed
* Initial work for streaming app shell way of using serviceworkers
* Close in on serviceworker adjustment finalization
* Add docs and loading indicator
* Remove useless code
* Don't run on API
* Update app/javascript/contentDisplayPolicy/hideBlockedContent.js
* Fix small details
* Don't run serviceworker.js code in test env
* Fix JS in serviceworker
* Move private keyword to proper place in async controller
* Change shell_version to HEROKU_SLUG_COMMIT
* Update caching config
* Add test for async_info/shell_version
* Add ApplicationMetalController to relevant controllers
* Add request forgery protection to metal
* Remove logger call
* Add logger keyword and skip protect_from_forgery in test
* Uncomment main_image in test
* Replace current_user.id with efficient_current_user_id in high-leverage areas
* Update name of efficient_current_user_id
* Replace user_signed_in? in pageviews
* Remove unneeded ?
* set up refactored onboarding
* create onboarding page
* add in first slide and change slide functionality
* fix test suite
* profile refactor
* profile refactor
* refactor to api
* add checkbox fields
* add checkbox fields
* remove puts
* add basic css
* add styling
* add redirect
* hide back and next at first and last slides
* test refactored onboarding
* test refactored onboarding
* remove article edits
* Fix schema
* Add deleted file back in
* Add default value for checked_t&c column
* Adjust HTML structure to keep nav buttons in place
* Fix ESLint issues on Onboarding.jsx file
* Handling for undefined or empty followedTags on getUserTags
* Fix codeclimate issues
* Fix codeclimate issues
* Fix more codeclimate issues
* Fix more codeclimate issues
* Update Onboarding snapshots
* Uncheck the CoC and T&C checkboxes on render
* Update snapshots
* Return false instead of raising error
* Update spec to use new onboarding
* Redirect to onboarding if haven't seen it yet
* Prevent redirect to onboarding from /signout_confirm
* Use assign_attributes instead of saving twice
* Move COC and T&C checkbox page to second slide
* Add 'go back to original page' functionality
* Reuse ready prototype logic
* Keep track of the last visited onboarding page
* Fix email subscription bug
* Fix overflow issue for tags page
* Remove height to prevent page container scrolling
* Check for CoC and T&C for displaying onboarding
* Add InstantClick redirect and preserve referrer in client
* Fix async update + check by using localStorage
* Turn off onboarding for tests
* Finalize design for onboarding
* Finalize design for onboarding
* Make bulk follows during onboarding
* Fix bulk follow test
* Switch from deprecated honeycomb-rails to honeycomb-beeline
* Improve error handling, tests and add refactoring
* Fix multiple fetching test and add one more
The test wasn't actually testing the correct behavior, because the class
by default force fetches. It worked because it wasn't reloading the user
from the database.
* Test that Honeycomb's client is doing its thing
* Use some defensive programming to avoid any possible problem during shutdown
* Fix typo
* Use the new API to add fields to the current measured event
* Use default instrumentation and add user info to event
* Replace user.email with user.username, less personal data around
* Use mocking instead of calling Honeycomb.init
* Freeze time before traveling
* Remove a flaky test dependent on rand
* Add API endpoints for analytics
* Remove comment and spacing
* Use proper time formatting
* Refactor and clean up some logic
* Add pro and org member traits
* Use shared examples for analytics API spec
* Add analytics authorization specs
* Remove accidental include Pundit
* Raise not_authorized for invalid requests
* Make attributes and time methods private
* Add custom UnauthorizedError
* Raise and use rescue_from to handle 4xx requests
* Enforce date parameters to follow a specific format
* Use current user to allow same origin requests
* Use custom headers and not params for token auth
* Default to current user for same origin requests
* Use correct boolean for choosing user
* Update tests to use request headers and add stricter tests
* Add basic Honeycomb initializers
* Add some basic instrumentation, capture basic IDs
* Correctly alphabetize Gemfile, embed env in dataset names
* Actually reorder Gemfile because I can read
* Add custom tracing instrumentation to RssReader
* Improve timing/tracing info in RssReader
* Even make sure Errors show up in trace if possible
* Make sure we capture this as Rails traffic
* Swap in dev/test Libhoney::Clients as appropriate
* Move context-snagging bits into lib/instrumentation.rb
* Merging Gemfile lines seems to be my Achilles heel
* Delete old files and combine into one spec
* Write new reaction request spec
* Use a single route for logged in/out reaction count
* Refactor a bit
* Remove unused file
* Add reaction policy and spec
* Fix eslint issue
* Remove dead route
* added organization policy + spec
* user specs for is_org_admin?
* added authroize to organization controller
* admin policy + specs
* deleted enforce admin due to pundit policy redundancy
* applied admin policy to entire admin namespace
* refactoring analytics controller WIP - wanna test codeship
* Add protection against reactions to unpublished articles (#473)
* Add chat channel policy and spec (#474)
* Add comment policy and specs (#475)
* Fix edge case with apostrophes
* Add comment policy and specs
* Add login for deleting comment spec
* Change test to raise pundit error instead of 404
* Clean up comment destroy request specs
* Remove redundant raise
* Whitelist columns on to_json call (#477)
* Add pundit policy for several controllers (#476)
* Add pundit policy for several controllers
* Adjust video spec
* Fix tag request specs
* Add proper twilio tokens request specs
* Remove puts statements
* Add a couple basic request specs (#478)
* Add a few tests and fix user tag color bug (#482)
* Refactor handle_tag_index in stories_controller (#481)
* Modify valid_request_origin? (#483)
* Add misc specs and remove banned attribute from user model (#484)
* Fix missing Cloudinary tags and misc specs (#486)
* removing current_user_is_admin? to use .is_admin? method
* added missing org policy routes
* Add comment for all public controllers
* Fix edge case for test
* Authorize mod controller and add specs
* Refactor methods via inheritance and use only super_admin role
* Create policy method for analytics via article_policy and refactor
* Capitalize all buttons in dashboard page
* Fix org tests and remove old admin test
* Use only happy path for analytics
* Fix tests to use Pundit error
* Update org_policy spec
* Remove email blank onboarding redirect
* Add authorization specs for video upload
* Add registration spec
* Remove skip before actions for signup complete
* Use new param for abuse reports
* Remove else because it never runs
* Add more dashboard request specs
* Use let with no bang in case there are errors