{"action":"created","issue":{"url":"https://api.github.com/repos/freme-project/basic-services/issues/112","repository_url":"https://api.github.com/repos/freme-project/basic-services","labels_url":"https://api.github.com/repos/freme-project/basic-services/issues/112/labels{/name}","comments_url":"https://api.github.com/repos/freme-project/basic-services/issues/112/comments","events_url":"https://api.github.com/repos/freme-project/basic-services/issues/112/events","html_url":"https://github.com/freme-project/basic-services/issues/112","id":180888250,"number":112,"title":"[urlsupport filter] missing content-type causes error","user":{"login":"ArneBinder","id":3375489,"avatar_url":"https://avatars.githubusercontent.com/u/3375489?v=3","gravatar_id":"","url":"https://api.github.com/users/ArneBinder","html_url":"https://github.com/ArneBinder","followers_url":"https://api.github.com/users/ArneBinder/followers","following_url":"https://api.github.com/users/ArneBinder/following{/other_user}","gists_url":"https://api.github.com/users/ArneBinder/gists{/gist_id}","starred_url":"https://api.github.com/users/ArneBinder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArneBinder/subscriptions","organizations_url":"https://api.github.com/users/ArneBinder/orgs","repos_url":"https://api.github.com/users/ArneBinder/repos","events_url":"https://api.github.com/users/ArneBinder/events{/privacy}","received_events_url":"https://api.github.com/users/ArneBinder/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/freme-project/basic-services/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":{"login":"bgrusdt","id":19168976,"avatar_url":"https://avatars.githubusercontent.com/u/19168976?v=3","gravatar_id":"","url":"https://api.github.com/users/bgrusdt","html_url":"https://github.com/bgrusdt","followers_url":"https://api.github.com/users/bgrusdt/followers","following_url":"https://api.github.com/users/bgrusdt/following{/other_user}","gists_url":"https://api.github.com/users/bgrusdt/gists{/gist_id}","starred_url":"https://api.github.com/users/bgrusdt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgrusdt/subscriptions","organizations_url":"https://api.github.com/users/bgrusdt/orgs","repos_url":"https://api.github.com/users/bgrusdt/repos","events_url":"https://api.github.com/users/bgrusdt/events{/privacy}","received_events_url":"https://api.github.com/users/bgrusdt/received_events","type":"User","site_admin":false},"assignees":[{"login":"bgrusdt","id":19168976,"avatar_url":"https://avatars.githubusercontent.com/u/19168976?v=3","gravatar_id":"","url":"https://api.github.com/users/bgrusdt","html_url":"https://github.com/bgrusdt","followers_url":"https://api.github.com/users/bgrusdt/followers","following_url":"https://api.github.com/users/bgrusdt/following{/other_user}","gists_url":"https://api.github.com/users/bgrusdt/gists{/gist_id}","starred_url":"https://api.github.com/users/bgrusdt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgrusdt/subscriptions","organizations_url":"https://api.github.com/users/bgrusdt/orgs","repos_url":"https://api.github.com/users/bgrusdt/repos","events_url":"https://api.github.com/users/bgrusdt/events{/privacy}","received_events_url":"https://api.github.com/users/bgrusdt/received_events","type":"User","site_admin":false}],"milestone":null,"comments":6,"created_at":"2016-10-04T13:08:45Z","updated_at":"2016-10-19T10:06:46Z","closed_at":"2016-10-18T08:23:37Z","body":"Try this request (but use Postman, curl sets a default content-type):\r\n\r\n```\r\nPOST http://api-dev.freme-project.eu/current/toolbox/nif-converter?intype=url&input=http://beautifulberlin.blogspot.de/2009/07/short-history-of-berlin.html\r\n```\r\nI get:\r\n```\r\n{\"timestamp\":1475585730677,\"status\":500,\"error\":\"Internal Server Error\",\"exception\":\"java.lang.NullPointerException\",\"message\":\"No message available\",\"path\":\"/toolbox/nif-converter\"}\r\n```\r\n\r\nThis is because the page at `http://beautifulberlin.blogspot.de/2009/07/short-history-of-berlin.html` does not send a content-type header back, so the content-type variable is set to `null` [here](https://github.com/freme-project/basic-services/blob/master/filters/urlsupport-filter/src/main/java/eu/freme/bservices/filters/urlsupport/UrlSupportFilter.java#L82), but checked later with `isEmpty()`.\r\nIn general, I prefere to use `Strings.isNullOrEmpty(...)` to avoid such a problem. @jnehring Or is this bad in any way?\r\n\r\nFurthermore, it looks like there are cases that `ModifyRequestBodyWrapper` is initialised with `contentType=\"\"`, but ModifyRequestBodyWrapper defaults to `text/html` only, if it is `null`, not an empty string, see [here](https://github.com/freme-project/basic-services/blob/master/filters/urlsupport-filter/src/main/java/eu/freme/bservices/filters/urlsupport/ModifyRequestBodyWrapper.java#L97).\r\n"},"comment":{"url":"https://api.github.com/repos/freme-project/basic-services/issues/comments/254770138","html_url":"https://github.com/freme-project/basic-services/issues/112#issuecomment-254770138","issue_url":"https://api.github.com/repos/freme-project/basic-services/issues/112","id":254770138,"user":{"login":"bgrusdt","id":19168976,"avatar_url":"https://avatars.githubusercontent.com/u/19168976?v=3","gravatar_id":"","url":"https://api.github.com/users/bgrusdt","html_url":"https://github.com/bgrusdt","followers_url":"https://api.github.com/users/bgrusdt/followers","following_url":"https://api.github.com/users/bgrusdt/following{/other_user}","gists_url":"https://api.github.com/users/bgrusdt/gists{/gist_id}","starred_url":"https://api.github.com/users/bgrusdt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgrusdt/subscriptions","organizations_url":"https://api.github.com/users/bgrusdt/orgs","repos_url":"https://api.github.com/users/bgrusdt/repos","events_url":"https://api.github.com/users/bgrusdt/events{/privacy}","received_events_url":"https://api.github.com/users/bgrusdt/received_events","type":"User","site_admin":false},"created_at":"2016-10-19T10:06:46Z","updated_at":"2016-10-19T10:06:46Z","body":"Thank you @jnehring, thats good to know."}}
{"actor":{"display_login":"bgrusdt"}}