Skip to content

eval'ing fails on non-JSON S2S response body #27

@oehlschl

Description

@oehlschl

Reported in PX chat, but we're seeing the following error after some S2S calls:

perimeterx/internal/validators/perimeter_x_s2s_validator.rb:87:in `eval': (eval):2: syntax error, unexpected '<'

I'm guessing that the < is the opening of an HTML tag, and that for some reason PX is returning a non-JSON (maybe error) response.

This occurs here:
https://github.com/PerimeterX/perimeterx-ruby-sdk/blob/master/lib/perimeterx/internal/validators/perimeter_x_s2s_validator.rb#L87

IMO the response body shouldn't be parsed until the response code is checked (which currently happens on the line below).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions