Restore DOI content-negotiation redirect parity for wildcard and XML/RDF/Turtle Accept headers#1528
Closed
Copilot wants to merge 2 commits into
Closed
Restore DOI content-negotiation redirect parity for wildcard and XML/RDF/Turtle Accept headers#1528Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
…ders Agent-Logs-Url: https://github.com/datacite/lupo/sessions/2f1737e6-3f1e-4b0f-a444-096fd3046d3b Co-authored-by: ashwinisukale <1137325+ashwinisukale@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update PR to match current DataCite Content Negotiation parity behavior
Restore DOI content-negotiation redirect parity for wildcard and XML/RDF/Turtle Accept headers
May 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This updates DOI content negotiation to match current DataCite CN parity for unsupported XML/RDF/Turtle-style
Acceptheaders. Requests with*/*,application/xml,application/rdf+xml,text/turtle, andapplication/x-turtlenow redirect todoi.urlinstead of attempting to render a body or failing with 500.Controller behavior
respond_to303 See Otherredirect behaviorallow_other_host: trueParity-aligned Accept handling
Accept: */*no longer falls into a 500 pathAccept: application/xmlAccept: application/rdf+xmlAccept: text/turtleAccept: application/x-turtleSpecs
Original prompt
Update PR #1518 in repository datacite/lupo to match current DataCite Content Negotiation (CN) parity behavior.
Context / desired parity:
Required changes:
Notes:
Acceptance criteria:
The following is the prior conversation context from the user's chat exploration (may be truncated):
User: i have not applied crosssite solution
Assistant: Apply the Crosscitable require fix; that’s the single change that consistently eliminates
NameError: uninitialized constant JSON::LD::Contextin your request-spec runtime (where initializers weren’t reliably helping).1) Update
app/models/concerns/crosscitable.rbAdd these
requires at the very top of the file (before the module definition). This guarantees the constants bolognese references are loaded wheneverDoiis loaded.Notes:
# frozen_string_literal: true, keep it once.requires, place these with them.require "rdf/rdfxml"raisesLoadError, you’ll need to add gemrdf-rdfxmlto the Gemfile. Try first.2) Remove any temporary “debug graph” monkeypatches
Delete any initializer or override you added that redefines
Bolognese::MetadataUtils#graphto “not rescue NameError”. That debug code will now cause 500s and is no longer needed.3) Keep
Doi#rdf_xmland#turtlereturning 406 when graph can’t be builtMake sure you have (or revert to) this:
4) Re-run the failing specs
bundle exec rspec spec/requests/index_spec.rb:351If it still fails after this, paste the new failure output; at that point the most likely remaining issue will be either:
rdf-rdfxmlgem (LoadError fromrdf/rdfxml), orThis pull request was created from Copilot chat.