Merge branch 'master' into release
This commit is contained in:
		
						commit
						58a5008718
					
				| 
						 | 
				
			
			@ -25,7 +25,12 @@ class AppServiceProvider extends ServiceProvider
 | 
			
		|||
    public function boot()
 | 
			
		||||
    {
 | 
			
		||||
        // Set root URL
 | 
			
		||||
        URL::forceRootUrl(config('app.url'));
 | 
			
		||||
        $appUrl = config('app.url');
 | 
			
		||||
        if ($appUrl) {
 | 
			
		||||
            $isHttps = (strpos($appUrl, 'https://') === 0);
 | 
			
		||||
            URL::forceRootUrl($appUrl);
 | 
			
		||||
            URL::forceScheme($isHttps ? 'https' : 'http');
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // Custom validation methods
 | 
			
		||||
        Validator::extend('image_extension', function ($attribute, $value, $parameters, $validator) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -22,4 +22,12 @@ class UrlTest extends TestCase
 | 
			
		|||
        putenv('APP_URL=');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function test_url_helper_sets_correct_scheme_even_when_request_scheme_is_different()
 | 
			
		||||
    {
 | 
			
		||||
        putenv('APP_URL=https://example.com/');
 | 
			
		||||
        $this->refreshApplication();
 | 
			
		||||
        $this->get('http://example.com/login')->assertSee('https://example.com/dist/styles.css');
 | 
			
		||||
        putenv('APP_URL=');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
		Reference in New Issue