Skip to content

feat: Allow filtering in ConstantConverter based on type #925

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 2, 2021

Conversation

joachimvh
Copy link
Member

Closes #896.

@joachimvh joachimvh added the semver.minor Requires a minor version bump label Aug 20, 2021
@joachimvh joachimvh added this to the v1.1.0 milestone Aug 20, 2021
Copy link
Member

@RubenVerborgh RubenVerborgh left a comment

Choose a reason for hiding this comment

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

Great work, thanks!!

@joachimvh joachimvh merged commit ab06dd3 into main Sep 2, 2021
@joachimvh joachimvh deleted the feat/constant-types branch September 2, 2021 05:56
@angelo-v
Copy link

Thanks! Can you document how it is used?

I tried "options_disabledMediaRanges": ["application/pdf"] but yet instead of the raw PDF the data browser is served. My config is:

{
      "comment": "Serve the Mashlib Data Browser as default container representation",
      "@id": "urn:solid-server:default:DefaultUiConverter",
      "@type": "ConstantConverter",
      "filePath": "./node_modules/mashlib/dist/databrowser.html",
      "contentType": "text/html",
      "options_minQuality": 1,
      "options_container": true,
      "options_document": true,
      "options_disabledMediaRanges": ["application/pdf"]
}

@RubenVerborgh
Copy link
Member

That looks good! You're running v1.1.0?
Perhaps post a debug log, then we can check.

@angelo-v
Copy link

Yes I am running v1.1.0.

Turns out the option works fine, but the problem lies in ACL / authentication. If I grant public access to the PDF I can load it in the browser, but if the access is restricted it serves the data browser.

@RubenVerborgh
Copy link
Member

Super, that was the intended behavior, because Databrowser has a UI that helps you sign in.

@angelo-v
Copy link

Not sure if the behaviour is really intended like that, because even after signing in via UI I am getting served the HTML, not the raw PDF. I guess this is because the browser's get request ist getting a 401 still, since it does not include an Authorization header and plain cookies are not supported? (I tried with a data browser that is using @inrupt/solid-client-authn-browser, so this is not an issue with old-style auth)

@RubenVerborgh
Copy link
Member

RubenVerborgh commented Sep 21, 2021

I guess this is because the browser's get request ist getting a 401 still, since it does not include an Authorization header and plain cookies are not supported?

Yes, Databrowser is currently not compatible with the Solid specification; there is an active branch that is adding support, expected in the next couple of weeks.

@joachimvh joachimvh removed this from the v2.0.0 milestone Oct 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver.minor Requires a minor version bump
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Selectively enable/disable ConstantConverter for certain MIME types
3 participants