Skip to content

fix: malformed web link#2260

Open
jmarcoz1 wants to merge 2 commits intoinveniosoftware:masterfrom
jmarcoz1:fix/3308-malformed-web-link
Open

fix: malformed web link#2260
jmarcoz1 wants to merge 2 commits intoinveniosoftware:masterfrom
jmarcoz1:fix/3308-malformed-web-link

Conversation

@jmarcoz1
Copy link
Copy Markdown

@jmarcoz1 jmarcoz1 commented Feb 23, 2026

❤️ Thank you for your contribution!

Description

Please describe briefly your pull request.

As stated in inveniosoftware/invenio-app-rdm#3308, the Link field header entry was malformed when receiving type and profile simultaneously, which is solved in this PR by parsing that value in FAIRSignpostingProfileLvl1Serializer and LandingPageSchema

Checklist

Ticks in all boxes and 🟢 on all GitHub actions status checks are required to merge:

Frontend

Reminder

By using GitHub, you have already agreed to the GitHub’s Terms of Service including that:

  1. You license your contribution under the same terms as the current repository’s license.
  2. You agree that you have the right to license your contribution under the current repository’s license.

@tmorrell tmorrell requested a review from fenekku February 23, 2026 13:00
Copy link
Copy Markdown
Contributor

@fenekku fenekku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for spotting this! It's indeed the case that profile should be supported as an extension attribute/separate entry. serialize_item would need it too and black wants a different slice syntax : -1. I'll double-check once addressed and should be able to merge this fix in.

pid_value=obj["id"],
filename=entry["key"],
),
"type": entry["mimetype"],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The above logic for providing a profile extension attribute should also be placed here to be compliant. Probably not often or even typically the case, but it could be actually and the official signposting spec does allow for this too.

Comment on lines +77 to +84
if ";" in mimetype:
media_type, _, params = mimetype.partition(";")
entry = {"href": obj["links"]["self"], "type": media_type.strip()}
params = params.strip()
if params.startswith('profile="') and params.endswith('"'):
entry["profile"] = params[len('profile="'):-1]
else:
entry = {"href": obj["links"]["self"], "type": mimetype}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extract above as method/function for reuse in the serialize_item.

entry = {"href": obj["links"]["self"], "type": media_type.strip()}
params = params.strip()
if params.startswith('profile="') and params.endswith('"'):
entry["profile"] = params[len('profile="'):-1]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Black needs to appeased here 😁

@fenekku
Copy link
Copy Markdown
Contributor

fenekku commented Apr 6, 2026

Since no activity on this, I will take it over this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants