Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 5a0d78cf

Von Jan Büren vor fast 3 Jahren hinzugefügt

  • ID 5a0d78cf54f035ce638aa855e9d0476ac6769ed0
  • Vorgänger 953a2e7f
  • Nachfolger dfd65efe

Shop: Servernamen entweder mit Protokoll speichern oder Protokoll ergänzen

Unterschiede anzeigen:

SL/DB/Shop.pm
21 21
  push @errors, $::locale->text('The path is missing.')        unless $self->{path};
22 22
  push @errors, $::locale->text('The Host Name is missing')    unless $self->{server};
23 23
  push @errors, $::locale->text('The Host Name seems invalid') unless $self->{server} =~ m/[0-9A-Za-z].\.[0-9A-Za-z]/;
24
  push @errors, $::locale->text('The Proxy Name seems invalid') unless $self->{proxy} =~ m/[0-9A-Za-z].\.[0-9A-Za-z]/;
24
  push @errors, $::locale->text('The Protocol for Host Name seems invalid (expected: http:// or https://)!')
25
                                                               if ($self->{server} =~ m/:/ && $self->{server} !~ m/(^https:\/\/|^http:\/\/)/);
25 26
  push @errors, $::locale->text('The Proxy Name seems invalid') . $self->{proxy} . ':' unless !$self->{proxy} ||  $self->{proxy} =~ m/[0-9A-Za-z].\.[0-9A-Za-z]/;
26 27
  push @errors, $::locale->text('Orders to fetch neeeds a positive Integer')
27 28
                                                               unless $self->{orders_to_fetch} > 0;
SL/ShopConnector/Shopware6.pm
709 709
sub init_connector {
710 710
  my ($self) = @_;
711 711

  
712
  my $client = REST::Client->new(host => $self->config->server);
712
  my $protocol = $self->config->server =~ /(^https:\/\/|^http:\/\/)/ ? '' : $self->config->protocol . '://';
713
  my $client   = REST::Client->new(host => $protocol . $self->config->server);
713 714

  
714 715
  $client->getUseragent()->proxy([$self->config->protocol], $self->config->proxy) if $self->config->proxy;
715

  
716 716
  $client->addHeader('Content-Type', 'application/json');
717 717
  $client->addHeader('charset',      'UTF-8');
718 718
  $client->addHeader('Accept',       'application/json');

Auch abrufbar als: Unified diff