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

[GEOT-6608] Fix user-agent for OSM tiles #2954

Merged
merged 1 commit into from May 30, 2020

Conversation

ianturton
Copy link
Member

@ianturton ianturton commented May 30, 2020

Checklist

Reviewing is a process done by project maintainers, mostly on a volunteer basis. We try to keep the overhead as small as possible and appreciate if you help us to do so by completing the following items. Feel free to ask in a comment if you have troubles with any of them.

For all pull requests:

  • Confirm you have read the contribution guidelines
  • You have sent a Contribution Licence Agreement (CLA) as necessary (not required for small changes, e.g., fixing typos in documentation)
  • Make sure the first PR targets the master branch, eventual backports will be managed later. This can be ignored if the PR is fixing an issue that only happens in a specific branch, but not in newer ones.
  • The changes are not breaking the build in downstream projects using SNAPSHOT dependencies, GeoWebCache and GeoServer.

The following are required only for core and extension modules (they are welcomed, but not required, for unsupported modules):

  • There is an issue in Jira describing the bug/task/new feature (a notable exemptions is, changes not visible to end users). The ticket is for the GeoTools project, if the issue was found elsewhere it's a good practice to link to the origin ticket/issue.
  • The pull request contains changes related to a single objective. If multiple focuses cannot be avoided, each one is in its own commit and has a separate ticket describing it.
  • PR for bug fixes and small new features are presented as a single commit
  • Commit message must be in the form "[GEOT-XYZW] Title of the Jira ticket"
  • New unit tests have been added covering the changes
  • This PR passes all existing unit tests (test results will be reported by travis-ci after opening this PR)
  • This PR passes the QA checks (QA checks results will be reported by travis-ci after opening this PR)
  • Documentation has been updated accordingly.

Submitting the PR does not require you to check all items, but by the time it gets merged, they should be either satisfied or inapplicable.

return ImageIOExt.readBufferedImage(getUrl());

Map<String, String> headers = new HashMap<>();
headers.put("User-Agent", "Geotools Http client");
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
headers.put("User-Agent", "Geotools Http client");
headers.put("User-Agent", "Geotools HTTP client");

:-p

@ianturton ianturton merged commit d311d23 into geotools:master May 30, 2020
}

private InputStream setupInputStream(URL url, Map<String, String> headers) throws IOException {
HTTPClient client = new SimpleHttpClient();
Copy link
Member

Choose a reason for hiding this comment

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

Wondering if SimpleHttpClient should default to the new user agent. It's not the first time I see cascading blocked because servers don't like the Java user agent.

Copy link
Member Author

Choose a reason for hiding this comment

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

that might be an even better fix - I guess.

ianturton added a commit that referenced this pull request Oct 21, 2020
ianturton added a commit that referenced this pull request Oct 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants