Skip to content

The API fails when no Accept header is provided #638

@tloubrieu-jpl

Description

@tloubrieu-jpl

Checked for duplicates

No - I haven't checked

🐛 Describe the bug

When I sent a request to the API without a HTTP header I received a 500 error with no explanation.

Server side the logs say:

2025-04-17T22:36:19.855Z ERROR 7 --- [p-nio-80-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: java.lang.NullPointerException: Cannot invoke "String.split(String)" because "acceptHeaderValue" is null] with root cause 2025-04-17T22:36:19.855Z ERROR 7 --- [p-nio-80-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: java.lang.NullPointerException: Cannot invoke "String.split(String)" because "acceptHeaderValue" is null] with root cause
  2025-04-17T18:36:19.861-04:00
  2025-04-17T18:36:19.861-04:00 at gov.nasa.pds.api.registry.configuration.WebMVCConfig.selectFormatterClass(WebMVCConfig.java:168) ~[classes!/:na]
  2025-04-17T18:36:19.861-04:00
  2025-04-17T18:36:19.861-04:00
  2025-04-17T18:36:19.861-04:00
  2025-04-17T18:36:19.861-04:00
  2025-04-17T18:36:19.861-04:00
  2025-04-17T18:36:19.861-04:00
  2025-04-17T18:36:19.861-04:00
  2025-04-17T18:36:19.861-04:00
  2025-04-17T18:36:19.861-04:00
  2025-04-17T18:36:19.861-04:00
  2025-04-17T18:36:19.861-04:00
  2025-04-17T18:36:19.861-04:00
  2025-04-17T18:36:19.861-04:00
  2025-04-17T18:36:19.861-04:00
  2025-04-17T18:36:19.861-04:00

🕵️ Expected behavior

I expected [...]

📜 To Reproduce

...

🖥 Environment Info

  • Version of this software [e.g. vX.Y.Z]
  • Operating System: [e.g. MacOSX with Docker Desktop vX.Y]
    ...

📚 Version of Software Used

No response

🩺 Test Data / Additional context

No response

🦄 Related requirements

🦄 #xyz

⚙️ Engineering Details

No response

🎉 Integration & Test

No response

Metadata

Metadata

Assignees

Labels

Type

Projects

Status

ToDo

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions