Skip to content
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

Remove restricted params from urls #1083

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

ZakarFin
Copy link
Member

@ZakarFin ZakarFin commented Nov 13, 2024

If a WFS-layer is registered to the application with an URL containing request, version or service parameters some things will break for example the capabilities parser that tries to call request=DescribeFeatureType. This results in calls having something like request=GetCapabilities&request=DescribeFeatureType when fetching the featuretype documentation.

This is first attempt with what I consider the "right places" for doing this:

  • MapLayer is used when inserting layers from JSON at the startup and when admin UI is used.
  • ServiceConnectInfo is used for fetching capabilities and handles the issue when there are layers in the database that has the problematic parameters on the URL.

However, we might need to support resources:// protocol for urls (used in thematic maps) and regenerating the url is pretty nasty looking at this point (generating arrays and strings for each param).

Related to: oskariorg/oskari-frontend#2569


@Test
public void getSanitizedUrl() {
assertEquals("https://jee.org/?apikey=woot&proxy=not", LayerUrlHelper.getSanitizedUrl("https://jee.org/?apikey=woot&request=GetWheel&proxy=not"));
Copy link
Member

Choose a reason for hiding this comment

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

GetWheel 🙊

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