You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.
Passing this payload to the isJson interceptor method: "↵[{"foo":"bar"}] (Where ↵ is %x0A or new line) evaluates to false.
What is Expected?
Per the spec on https://tools.ietf.org/html/rfc7159#page-5 : "Insignificant whitespace is allowed before or after any of the six structural characters.", thus this should evaluate to true.
Reproduction
Passing this payload to the isJson interceptor method:
"↵[{"foo":"bar"}]
(Where↵
is%x0A
or new line) evaluates tofalse
.What is Expected?
Per the spec on https://tools.ietf.org/html/rfc7159#page-5 : "Insignificant whitespace is allowed before or after any of the six structural characters.", thus this should evaluate to
true
.EDIT:
I suggested to add \s* to the regex, but this doesn't include the fact that
true
,false
,null
, numbers and string literals are also valid. Although I suspect that including string and number literals is not desirable.https://github.com/pagekit/vue-resource/blob/master/src/http/interceptor/json.js#L43
The text was updated successfully, but these errors were encountered: