xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremias Maerki <...@jeremias-maerki.ch>
Subject Re: Bug report - URIResolver and basic authentication working incorrect when EBCDIC codepage is used
Date Fri, 11 May 2007 07:14:06 GMT
Fixed in FOP Trunk (hopefully):
http://svn.apache.org/viewvc?view=rev&rev=537120

Thanks for spotting the problem.

On 10.05.2007 16:20:04 jelka.kosir wrote:
> Similar to my previous mail I have a problem retrieving images from a 
> database that uses basic authentication.
> 
> Looking at the code I think the problem is again in the EBCDIC codepage 
> that is used on the server.
> 
> The problem is bolded:
> 
> protected void applyHttpBasicAuthentication(URLConnection connection, 
>             String username, String password) {
>         String combined = username + ":" + password;
>         try {
>             ByteArrayOutputStream baout = new 
> ByteArrayOutputStream(combined.length() * 2);
>             Base64EncodeStream base64 = new Base64EncodeStream(baout);
>             base64.write(combined.getBytes());
>             base64.close();
>             connection.setRequestProperty("Authorization", 
>                     "Basic " + new String(baout.toByteArray()));
>         } catch (IOException e) {
>             //won't happen. We're operating in-memory.
>             throw new RuntimeException("Error during base64 encodation of 
> username/password");
>         }
>     }
> 
> This function is defined in: 
> src\java\org\apache\fop\apps\FOURIResolver.java
> 
> I will try with base64.write(combined.getBytes("UTF-8"));
> 
> Will keep you posted.
> 
> Jelka



Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Mime
View raw message