{"action":"opened","issue":{"url":"https://api.github.com/repos/saucelabs/saucerest-java/issues/68","repository_url":"https://api.github.com/repos/saucelabs/saucerest-java","labels_url":"https://api.github.com/repos/saucelabs/saucerest-java/issues/68/labels{/name}","comments_url":"https://api.github.com/repos/saucelabs/saucerest-java/issues/68/comments","events_url":"https://api.github.com/repos/saucelabs/saucerest-java/issues/68/events","html_url":"https://github.com/saucelabs/saucerest-java/issues/68","id":373101474,"node_id":"MDU6SXNzdWUzNzMxMDE0NzQ=","number":68,"title":"Exception \"Illegal characters\" when calling jobFailed()","user":{"login":"robertarles","id":18435,"node_id":"MDQ6VXNlcjE4NDM1","avatar_url":"https://avatars1.githubusercontent.com/u/18435?v=4","gravatar_id":"","url":"https://api.github.com/users/robertarles","html_url":"https://github.com/robertarles","followers_url":"https://api.github.com/users/robertarles/followers","following_url":"https://api.github.com/users/robertarles/following{/other_user}","gists_url":"https://api.github.com/users/robertarles/gists{/gist_id}","starred_url":"https://api.github.com/users/robertarles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robertarles/subscriptions","organizations_url":"https://api.github.com/users/robertarles/orgs","repos_url":"https://api.github.com/users/robertarles/repos","events_url":"https://api.github.com/users/robertarles/events{/privacy}","received_events_url":"https://api.github.com/users/robertarles/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-23T16:58:44Z","updated_at":"2018-10-23T16:58:44Z","closed_at":null,"author_association":"NONE","body":"The test runs (though fails) then an exception is thrown when trying to set the results on he saucelabs job.\r\n\r\nIs this related to the code in SauceREST.java? Is there a workaround? \r\n\r\nIt seems that there is a /r/n tacked on to the \"header value: Basic\" The log snippet below is literal, except for the starred out chars.\r\n\r\n```\r\n    protected String encodeAuthentication() {\r\n        String auth = username + \":\" + accessKey;\r\n        auth = \"Basic \" + Base64.encodeBase64String(auth.getBytes());\r\n        return auth;\r\n    }\r\n```\r\n\r\nSauceREST info:\r\n\t    <groupId>com.saucelabs</groupId>\r\n\t    <artifactId>saucerest</artifactId>\r\n\t    <version>1.0.39</version>\r\n\r\n\r\n```\r\n10-23 09:45:37.756 [com.disney.appium.common.BaseTest tearDown] Recording results to saucelabs\r\n10-23 09:45:37.769 [com.disney.appium.common.BaseTest tearDown] Failed to record results to Saucelabs for jobId/sessionId [8dcaac8acc764170af341c508928c14e]\r\njava.lang.IllegalArgumentException: Illegal character(s) in message header value: Basic cm9iZXJ0YXJsZXN************************************************************\r\n\r\n\tat sun.net.www.protocol.http.HttpURLConnection.checkMessageHeader(HttpURLConnection.java:541)\r\n\tat sun.net.www.protocol.http.HttpURLConnection.isExternalMessageHeaderAllowed(HttpURLConnection.java:492)\r\n\tat sun.net.www.protocol.http.HttpURLConnection.setRequestProperty(HttpURLConnection.java:3057)\r\n\tat sun.net.www.protocol.https.HttpsURLConnectionImpl.setRequestProperty(HttpsURLConnectionImpl.java:316)\r\n\tat com.saucelabs.saucerest.SauceREST.addAuthenticationProperty(SauceREST.java:542)\r\n\tat com.saucelabs.saucerest.SauceREST.updateJobInfo(SauceREST.java:562)\r\n\tat com.saucelabs.saucerest.SauceREST.jobFailed(SauceREST.java:244)\r\n\tat com.disney.appium.common.BaseTest.tearDown(BaseTest.java:203)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:498)\r\n\tat org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:86)\r\n\tat org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:514)\r\n\tat org.testng.internal.Invoker.invokeConfigurations(Invoker.java:215)\r\n\tat org.testng.internal.Invoker.invokeMethod(Invoker.java:707)\r\n\tat org.testng.internal.Invoker.invokeTestMethod(Invoker.java:820)\r\n\tat org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1128)\r\n\tat org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)\r\n\tat org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)\r\n\tat org.testng.TestRunner.privateRun(TestRunner.java:782)\r\n\tat org.testng.TestRunner.run(TestRunner.java:632)\r\n\tat org.testng.SuiteRunner.runTest(SuiteRunner.java:366)\r\n\tat org.testng.SuiteRunner.runSequentially(SuiteRunner.java:361)\r\n\tat org.testng.SuiteRunner.privateRun(SuiteRunner.java:319)\r\n\tat org.testng.SuiteRunner.run(SuiteRunner.java:268)\r\n\tat org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)\r\n\tat org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)\r\n\tat org.testng.TestNG.runSuitesSequentially(TestNG.java:1244)\r\n\tat org.testng.TestNG.runSuitesLocally(TestNG.java:1169)\r\n\tat org.testng.TestNG.run(TestNG.java:1064)\r\n\tat org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:217)\r\n\tat org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:84)\r\n\tat org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:92)\r\n\tat org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)\r\n\tat org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)\r\n\tat org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)\r\n\r\n```"}}
{"actor":{"display_login":"robertarles"}}