Skip to content

Safe calling content-type header for Javascript exception tracking#141

Merged
UberMouse merged 1 commit intoMindscapeHQ:masterfrom
kaodim:handl-nil-content-type-header
Feb 19, 2019
Merged

Safe calling content-type header for Javascript exception tracking#141
UberMouse merged 1 commit intoMindscapeHQ:masterfrom
kaodim:handl-nil-content-type-header

Conversation

@yamanaltereh
Copy link
Contributor

@yamanaltereh yamanaltereh commented Jan 31, 2019

  • Getting error *** NoMethodError Exception: undefined method `include?' for nil:NilClass
    for this block in JavascriptExceptionTracking class
      if headers['Content-Type'].include?('text/html')
        response = inject_javascript_to_response(response)
      end
  • somehow the headers['Content-Type'] is nil when there's 404 exception and getting 500 error instead of 404

  • Using Rails 5.1.6 and jbuilder gem with json format response

@andrewjanssen
Copy link

Thanks @yamanaltereh!

@UberMouse UberMouse merged commit b87dfd7 into MindscapeHQ:master Feb 19, 2019
@UberMouse
Copy link
Contributor

Thanks for fixing this @yamanaltereh

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.

3 participants