eclipse-ee4j / eclipse-ee4j/jersey

@JSONP's Accept header requirement is impractical

Open
#3,509 3 comments 0 reactions 0 assignees View on GitHub
Priority: Major Type: Improvement
Dominant language
Java
Stars
730
Forks
382
PR merge metrics
No merged PRs in 30d

Description

The examples in the docs suggest that executing curl without passing a header like `curl -H 'Accept: application/javascript' ` should result in a JSON with padding. However, reimplementing that example with `jersey-media-json-processing` module requires me to pass that header. If there is some way around the accept header requirement, I couldn't figure it out from the documentation.

If there isn't, then my real problem follows from this restriction: The accept header sent by chrome when inserting creating a script element (even with the attribute type="text/javascript") ends up sending a header `Accept: **/**`. Since it doesn't satisfy Jersey's requirement, it sends plain JSON and my @JSONP annotated endpoint becomes unusable.
#### Affected Versions
[2.25.1]

Contributor guide

Open the contributing guide

Research direction

Start with the documentation's curl example and the jersey-media-json-processing module, then compare its Accept handling with Chrome's script-element request. The issue is done when the documentation or JSONP behavior clearly addresses application/javascript versus */* and states the supported outcome.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.