Skip to content

Channels: Get channels with param valid name and empty ignoreCase returns a 500 status code #52

@sphinix27

Description

@sphinix27

Description


In channels endpoint it is possible to filter channels by name like: '/channels?name=something&ignoreCase=FALSE'. It finds any channel with the exactly same name provided, if ignoreCase is set to true it will ignore the name is with uppercase or downcase. If you send the filter ignoreCase empty like: '/channels?name=something&ignoreCase=' it returns a 500 status code with a response saying is a Null Pointer Exception. This also happens when you send params like: '/channels?name=&ignoreCase='.

Environment


  • An Notifier Server installed with version 1.0
  • Operating System and version: Windows Server 2012 R2

Requirements


  • Rest Client: E.g. Postman.
  • Any Channel already created:

API

  • Method: GET
  • Endpoint: /api/channels?name=channel&ignoreCase=

Steps to Reproduce


  1. Open Postman.
  2. In Postman select 'GET' method for URL.
  3. In Postman Enter the endpoint to retrieve channels. E.g. 'http://128.0.0.1/api/channels?name=valid&ignoreCase='
  4. Click on Send button.
  5. Verify the response has a 400 status code.
  6. Verify the response is similar to:
{
    "timestamp": 1507722938867,
    "status": 400,
    "error": "Bad Request",
    "exception": "org.springframework.web.method.annotation.MethodArgumentTypeMismatchException",
    "message": "Bad Request",
    "path": "/channels"
}

Actual Result


The status code is 500 and the response contains:

{
    "timestamp": 1507724207772,
    "status": 500,
    "error": "Internal Server Error",
    "exception": "java.lang.NullPointerException",
    "message": "Request processing failed; nested exception is java.lang.NullPointerException",
    "path": "/channels"
}

Expected Result


The status code should be 400 and the response contains a bad request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions