Merge pull request #2517 from schleif/master

add http referer to shop webview
This commit is contained in:
Dominik Schürmann 2019-12-17 12:53:39 +01:00 committed by GitHub
commit 084f73f1f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -32,9 +32,13 @@ import android.widget.TextView;
import org.sufficientlysecure.keychain.R;
import java.util.HashMap;
import java.util.Map;
public class SecurityKeyShopFragment extends Fragment {
public static final String webShopURL = "https://shop.cotech.de/";
public static final String referer = "https://openkeychain.shop.cotech.de";
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.security_key_shop_fragment, container, false);
@ -45,7 +49,9 @@ public class SecurityKeyShopFragment extends Fragment {
view.findViewById(R.id.shop_progressbar_label)
));
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl(webShopURL);
Map<String, String> headers = new HashMap<>();
headers.put("Referer", referer);
webView.loadUrl(webShopURL, headers);
return view;
}