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

Enable RestMap and deliver test #240

Conversation

philboeselager
Copy link
Contributor

} catch (final IOException e) {
throw new MetafactureException(e);
private String readFromUrl(final String url) throws IOException, URISyntaxException {
InputStream inputStream = new URL(new URI(url.replace(" ", "%20")).toASCIIString()).openConnection()
Copy link
Member

Choose a reason for hiding this comment

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

Why is the url.replace(" ", "%20") necessary here? The test data does not seem to contain a space, or am I misunderstanding something?

If in general characters that need encoding should be supported here, wouldn't a general approach like calling URLEncoder.encode(String s, String enc) with key.toString() when building the URL be safer?

And can we get rid of the .toASCIIString() to support keys like organisations?q=Köln, if that makes any sense?

@cboehme cboehme self-assigned this Oct 26, 2016
@cboehme cboehme closed this in 2ea12b6 Oct 28, 2016
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