[ 
https://issues.apache.org/jira/browse/FELIX-5680?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16143959#comment-16143959
 ] 

ASF GitHub Bot commented on FELIX-5680:
---------------------------------------

GitHub user dangiankit opened a pull request:

    https://github.com/apache/felix/pull/119

    [FELIX-5680] Add createResource(URLConnection conn) to DataModelHelperImpl

    - Allows for URLs to support Authorization and other HttpHeaders.
    - Calls FileUtil.openURL(URLConnection conn) rather than 
FileUtil.openURL(URL url).
    - JIRA: https://issues.apache.org/jira/browse/FELIX-5680

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/dangiankit/felix AD-FELIX-5680

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/felix/pull/119.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #119
    
----
commit 533e0e926567efe509f3f75c15b5a8bb906adea4
Author: dangiankit <dangian...@gmail.com>
Date:   2017-08-28T16:16:09Z

    [FELIX-5680] Add createResource(URLConnection conn) to DataModelHelperImpl
    
    - Allows for URLs to support Authorization and other HttpHeaders.
    - Calls FileUtil.openURL(URLConnection conn) rather than
    FileUtil.openURL(URL url).

----


> Add createResource(URLConnection conn) to DataModelHelperImpl to support URLs 
> that require Authentication
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-5680
>                 URL: https://issues.apache.org/jira/browse/FELIX-5680
>             Project: Felix
>          Issue Type: Bug
>          Components: Bundle Repository (OBR)
>    Affects Versions: bundlerepository-2.0.10
>         Environment: macOS 10.12.6, Felix 5.6.4
>            Reporter: Ankit Dangi
>             Fix For: bundlerepository-2.0.12
>
>
> Referring to classes: 
> * org.apache.felix.bundlerepository.impl.DataModelHelperImpl.java 
> * org.apache.felix.bundlerepository.impl.FileUtil.java
> Current scenario: The method DataModelHelperImpl.createResource(URL 
> bundleUrl) has an inner method loadEntry(String name) that calls 
> FileUtil.openURL(bundleUrl) on the line 479. FileUtil.openURL(URL bundleURL) 
> is a helper function for FileUtil.openURL(URLConnection conn). 
> Problem: It restricts the use of URL connections that require authorization. 
> As a result, a 401 error occurs for bundleURLs that require 
> HttpHeaders.AUTHORIZATION. Note: It is not the same as setting 
> Proxy-Authorization because Authorization is a different HTTPHeader. 
> Possible Solution: Overload the DataModelHelperImpl.createResource() such 
> that it takes as input a URLConnection object which then calls the 
> FileUtil.openURL(conn). An URLConnection object has method 
> setRequestProperty(key, value) which could then make it possible for 
> DataModelHelperImpl.createResource() to handle diverse scenarios. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to