Skip to content

RegExp in $in inside query does not get passed to server properly. #170

@Critical-Impact

Description

@Critical-Impact

Steps to reproduce

This is between a client and server. The query being used is
{ query: { $skip: 0, subdomains: {$in: [new RegExp("^.*test.*$","i")] } } }

This is what the server receives, this appears to be what the client sends so the server is definitely not mangling the request.

{ query: { $skip: 0, subdomains: {$in: [{}] } } }

If I like at the websocket connection the data being sent from the client has the {}

I have been able to work around this by passing a string then using a hook on the server end to convert it back into a regular expression.

I am wondering if this is the expected behaviour?

I can provide more detailed examples if required though it'll take me a little while.

I would have tried slack first but it appears to be down.

Expected behavior

I suppose I'd expect it to either send the regexp as is, warn you that you've passed in an invalid value or convert it client side and then convert it back server side.

Actual behavior

It turns the RegExp into a {}

System configuration

Module versions
"@feathersjs/authentication": "^4.3.7",
"@feathersjs/authentication-local": "^4.3.7",
"@feathersjs/authentication-oauth": "^4.3.7",
"@feathersjs/configuration": "^4.3.7",
"@feathersjs/errors": "^4.3.7",
"@feathersjs/express": "^4.3.7",
"@feathersjs/feathers": "^4.3.7",
"@feathersjs/socketio": "^4.3.7",
"@feathersjs/transport-commons": "^4.3.7",
"feathers-authentication-hooks": "^1.0.1",
"feathers-hooks-common": "^4.20.7",
"feathers-mongodb": "^6.0.0",
"feathers-mongodb-fuzzy-search": "^1.1.1",
"feathers-permissions": "https://github.com/Critical-Impact/feathers-permissions.git#master",
"mongodb": "^3.3.3",

NodeJS version:
v10.16.0

Operating System:
Windows 10

Browser Version:
Firefox 70.0.1 (64-bit)

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