Compare commits
2 Commits
db4997fdc4
...
e7979fe9db
Author | SHA1 | Date | |
---|---|---|---|
e7979fe9db | |||
7a276adbbc |
@ -1246,7 +1246,7 @@ static void _httpd_endpoint_view_work(tf_ssb_t* ssb, void* user_data)
|
||||
{
|
||||
view_t* view = user_data;
|
||||
tf_http_request_t* request = view->request;
|
||||
char blob_id[128] = "";
|
||||
char blob_id[k_blob_id_len] = "";
|
||||
|
||||
user_app_t* user_app = _parse_user_app_from_path(request->path, "/view");
|
||||
if (user_app)
|
||||
@ -1339,7 +1339,7 @@ typedef struct _save_t
|
||||
{
|
||||
tf_http_request_t* request;
|
||||
int response;
|
||||
char blob_id[256];
|
||||
char blob_id[k_blob_id_len];
|
||||
} save_t;
|
||||
|
||||
static void _httpd_endpoint_save_work(tf_ssb_t* ssb, void* user_data)
|
||||
@ -1416,12 +1416,12 @@ static void _httpd_endpoint_save_work(tf_ssb_t* ssb, void* user_data)
|
||||
size_t new_app_length = 0;
|
||||
const char* new_app_str = JS_ToCStringLen(context, &new_app_length, new_app_json);
|
||||
|
||||
char blob_id[250] = { 0 };
|
||||
char blob_id[k_blob_id_len] = { 0 };
|
||||
if (tf_ssb_db_blob_store(ssb, (const uint8_t*)new_app_str, new_app_length, blob_id, sizeof(blob_id), NULL) &&
|
||||
tf_ssb_db_set_property(ssb, user_app->user, app_path, blob_id))
|
||||
{
|
||||
tf_ssb_db_add_value_to_array_property(ssb, user_app->user, "apps", user_app->app);
|
||||
snprintf(save->blob_id, sizeof(save->blob_id), "/%s", blob_id);
|
||||
snprintf(save->blob_id, sizeof(save->blob_id), "%s", blob_id);
|
||||
save->response = 200;
|
||||
}
|
||||
|
||||
@ -1446,10 +1446,10 @@ static void _httpd_endpoint_save_work(tf_ssb_t* ssb, void* user_data)
|
||||
}
|
||||
else if (strcmp(request->path, "/save") == 0)
|
||||
{
|
||||
char blob_id[250] = { 0 };
|
||||
char blob_id[k_blob_id_len] = { 0 };
|
||||
if (tf_ssb_db_blob_store(ssb, request->body, request->content_length, blob_id, sizeof(blob_id), NULL))
|
||||
{
|
||||
snprintf(save->blob_id, sizeof(save->blob_id), "/%s", blob_id);
|
||||
snprintf(save->blob_id, sizeof(save->blob_id), "%s", blob_id);
|
||||
save->response = 200;
|
||||
}
|
||||
}
|
||||
@ -1473,7 +1473,9 @@ static void _httpd_endpoint_save_after_work(tf_ssb_t* ssb, int status, void* use
|
||||
tf_http_request_t* request = save->request;
|
||||
if (*save->blob_id)
|
||||
{
|
||||
tf_http_respond(request, 200, NULL, 0, save->blob_id, strlen(save->blob_id));
|
||||
char body[256] = "";
|
||||
int length = snprintf(body, sizeof(body), "/%s", save->blob_id);
|
||||
tf_http_respond(request, 200, NULL, 0, body, length);
|
||||
}
|
||||
tf_http_request_unref(request);
|
||||
tf_free(save);
|
||||
|
@ -90,7 +90,7 @@ void tf_ssb_export(tf_ssb_t* ssb, const char* key)
|
||||
return;
|
||||
}
|
||||
|
||||
char app_blob_id[64] = { 0 };
|
||||
char app_blob_id[k_blob_id_len] = { 0 };
|
||||
sqlite3* db = tf_ssb_acquire_db_reader(ssb);
|
||||
sqlite3_busy_timeout(db, 10000);
|
||||
sqlite3_stmt* statement;
|
||||
|
@ -260,7 +260,12 @@ try:
|
||||
driver.find_element(By.TAG_NAME, 'tf-auth').shadow_root.find_element(By.ID, 'confirm').send_keys('new_password')
|
||||
driver.find_element(By.TAG_NAME, 'tf-auth').shadow_root.find_element(By.ID, 'loginButton').click()
|
||||
wait.until(expected_conditions.presence_of_element_located((By.ID, 'document')))
|
||||
driver.find_element(By.TAG_NAME, 'tf-navigation').shadow_root.find_element(By.ID, 'identity').click()
|
||||
while True:
|
||||
try:
|
||||
driver.find_element(By.TAG_NAME, 'tf-navigation').shadow_root.find_element(By.ID, 'identity').click()
|
||||
break
|
||||
except:
|
||||
pass
|
||||
driver.find_element(By.TAG_NAME, 'tf-navigation').shadow_root.find_element(By.ID, 'logout').click()
|
||||
driver.find_element(By.TAG_NAME, 'tf-auth').shadow_root.find_element(By.ID, 'login_label').click()
|
||||
driver.find_element(By.TAG_NAME, 'tf-auth').shadow_root.find_element(By.ID, 'name').send_keys('testuser')
|
||||
|
Loading…
Reference in New Issue
Block a user