Merge pull request #2517 from schleif/master
add http referer to shop webview
This commit is contained in:
commit
084f73f1f5
|
@ -32,9 +32,13 @@ import android.widget.TextView;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public class SecurityKeyShopFragment extends Fragment {
|
public class SecurityKeyShopFragment extends Fragment {
|
||||||
|
|
||||||
public static final String webShopURL = "https://shop.cotech.de/";
|
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) {
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
View view = inflater.inflate(R.layout.security_key_shop_fragment, container, false);
|
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)
|
view.findViewById(R.id.shop_progressbar_label)
|
||||||
));
|
));
|
||||||
webView.getSettings().setJavaScriptEnabled(true);
|
webView.getSettings().setJavaScriptEnabled(true);
|
||||||
webView.loadUrl(webShopURL);
|
Map<String, String> headers = new HashMap<>();
|
||||||
|
headers.put("Referer", referer);
|
||||||
|
webView.loadUrl(webShopURL, headers);
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue