- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 431
Added configuration option for proxy usage #609
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
          
     Merged
      
      
    
                
     Merged
            
            
          Conversation
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
    
              
                    rsora
  
              
              approved these changes
              
                  
                    Mar 10, 2020 
                  
              
              
            
            
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
For the records, this PR follows bugst/go-downloader#2
c95253b    to
    f5b386e      
    Compare
  
    This change allows to not pass-trough the downloader configuration from function to function everywhere (and sometime we forget to pass it for example in the "core update-index" command).
It's better to read the network configuration before each http request so in case it is changed using "Settings" functions in daemon mode the changes are immediately applied.
| In the meantime I've changed the implementaion. 
 | 
f5b386e    to
    16e0871      
    Compare
  
    
              
                    rsora
  
              
              approved these changes
              
                  
                    Apr 16, 2020 
                  
              
              
            
            
    
  rsora 
      pushed a commit
      that referenced
      this pull request
    
      Apr 16, 2020 
    
    
      
  
    
      
    
  
* Use downloader.SetDefaultConfig() to set user-agent for the arduino-cli This change allows to not pass-trough the downloader configuration from function to function everywhere (and sometime we forget to pass it for example in the "core update-index" command). * Add support for network proxy configuration * Cosmetic: added blank space in configuration/defaults.go * Update go-downloader to 1.2.0 * Refactored function to generate user-agent * Added a TODO for missing proxy usage in board list API query * Partially revert global network configuration. It's better to read the network configuration before each http request so in case it is changed using "Settings" functions in daemon mode the changes are immediately applied.
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
      
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
This PR makes a bunch of changes:
usedownloader.SetDefaultConfig()to set globally the user-agent: this allows to avoid passing headers back and forthpreviously in thecore update-indexcommand user agent headers wasn't set when downloading: with the globaldownloader.SetDefaultConfig(...)this is no more a problem.daemonmode).board listwithout usingdownloaderlibrary, so it ignores the global network settings. I've added a TODO for missing proxy usage.