Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
appinventor-sources
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
appinventor-sources
Commits
6f939f64
Unverified
Commit
6f939f64
authored
Mar 03, 2019
by
Evan W. Patton
Committed by
Jeffrey I. Schiller
Mar 03, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Attempt HTTPS version of URL if HTTP redirect fails due to lack of CORS
Change-Id: I32f1bba6e7f1db17321665612a8ff2c2236446fb
parent
1ef81e50
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
appinventor/appengine/src/com/google/appinventor/client/wizards/TemplateUploadWizard.java
...ogle/appinventor/client/wizards/TemplateUploadWizard.java
+8
-4
No files found.
appinventor/appengine/src/com/google/appinventor/client/wizards/TemplateUploadWizard.java
View file @
6f939f64
...
...
@@ -656,7 +656,7 @@ public class TemplateUploadWizard extends Wizard implements NewUrlDialogCallback
* @param url A string of the form "http://... .asc
* @param onSuccessCommand
*/
private
static
void
openTemplateProject
(
String
url
,
final
NewProjectCommand
onSuccessCommand
)
{
private
static
void
openTemplateProject
(
final
String
url
,
final
NewProjectCommand
onSuccessCommand
)
{
final
Ode
ode
=
Ode
.
getInstance
();
// This Async callback is called after the project is input and created
...
...
@@ -703,9 +703,13 @@ public class TemplateUploadWizard extends Wizard implements NewUrlDialogCallback
// Response received from the GET
@Override
public
void
onResponseReceived
(
Request
request
,
Response
response
)
{
// The response.getText is the zip data used to create a new project.
// The callback opens the project
ode
.
getProjectService
().
newProjectFromExternalTemplate
(
projectName
,
response
.
getText
(),
callback
);
// The response.getText is the zip data used to create a new project.
// The callback opens the project
if
(
response
!=
null
&&
response
.
getStatusCode
()
==
200
&&
response
.
getText
()
!=
null
&&
!
response
.
getText
().
isEmpty
())
{
ode
.
getProjectService
().
newProjectFromExternalTemplate
(
projectName
,
response
.
getText
(),
callback
);
}
else
if
(
url
.
startsWith
(
"http:"
))
{
openTemplateProject
(
url
.
replaceFirst
(
"http:"
,
"https:"
),
onSuccessCommand
);
}
}
});
}
catch
(
RequestException
e
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment