Skip to content

PB-1550 : Add a pre-processing hook to circumvent content-type mismatch #15

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

Open
wants to merge 1 commit into
base: geoadmin_master
Choose a base branch
from

Conversation

sami-nouidri-swisstopo
Copy link

Based on @m-mohr 's suggestion

@sami-nouidri-swisstopo
Copy link
Author

@hansmannj @ltshb from my testing, this workaround doesn't seem to work as we get HTTP 406 errors when querying the search endpoint from STAC-Browser.

image

This is most likely due to the fact that our STAC implementation expects a "application/json" accept header. I've written a script to test this manually, and when switching to "application/geo+json", I get the same error when querying the search endpoint with a POST request :

image

Should we consider changing the search endpoint implementation?

image

stac.conformsTo.push('https://api.stacspec.org/v1.0.0/item-search');
stac.links = stac.links.map(link => {
if (link.rel === 'search') {
link.type = 'application/geo+json';
Copy link

Choose a reason for hiding this comment

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

I don't know the STAC browser code but I do know that we are currently unable to serve STAC content via application/geo+json, did you simply try to modify this line to application/json what our STAC supports ?

Copy link
Author

Choose a reason for hiding this comment

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

Yes, but according to @m-mohr , the STAC-Browser has been made more restrictive on the matter, which is why our search feature no longer works - so I can't use application/json sadly
image

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.

2 participants