╭ changed ──╮ │src/web.zig│ ╰───────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │134 if (method == .POST) { │ │135 switch (host) { │ │136 .remote => |remote| { │ │137 - const PostRoute = enum { login, logout, ansi, new, edit, remove, open, close, resolve, post, attach }; │ │137 + const PostRoute = enum { login, logout, ansi, new, edit, remove, open, close, resolve, publish, attach };│ │138 inline for (@typeInfo(PostRoute).@"enum".fields) |field| { │ │139 const suffix = "/" ++ field.name; │ │140 if (std.mem.endsWith(u8, path, suffix)) { │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │149 .open => handleThreadStatus(io, request, allocator, base, host, true), │ │150 .close => handleThreadStatus(io, request, allocator, base, host, false),│ │151 .resolve => handleThreadResolve(io, request, allocator, base, host), │ │152 - .post => handlePatchPost(io, request, allocator, base, host), │ │152 + .publish => handlePatchPublish(io, request, allocator, base, host), │ │153 .attach => handleAttach(io, request, allocator, base, host), │ │154 }; │ │155 } │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │640 return .{ .repo_base = base[0..repo_base_len], .thread_kind = thread_kind, .thread_id = thread_id, .comment_id = comment_id };│ │641 } │ │642 │ │643 -fn handlePatchPost( │ │643 +fn handlePatchPublish( │ │644 io: std.Io, │ │645 request: *std.http.Server.Request, │ │646 allocator: std.mem.Allocator, │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────╮ │672 defer allocator.free(repos_dir); │ │673 const path = try fork.forkPath(allocator, repos_dir, &id); │ │674 defer allocator.free(path); │ │675 - try pch.post(.{}, io, allocator, &admin_repo, &target_repo, path, .{ │ │675 + try pch.publish(.{}, io, allocator, &admin_repo, &target_repo, path, .{│ │676 .id = id, │ │677 .user_id = user_id, │ │678 .repo_id = repo_id, │ ╰────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │706 defer author_arena.deinit(); │ │707 const author = (try eventAuthor(io, allocator, &author_arena, request, host)) orelse return respondLoginRequired(request);│ │708 │ │709 - const posted = try readFormBody(request, allocator); │ │710 - defer allocator.free(posted); │ │711 - const body_crlf = (try parseFormField(allocator, posted, "body")) orelse try allocator.dupe(u8, ""); │ │709 + const form_body = try readFormBody(request, allocator); │ │710 + defer allocator.free(form_body); │ │711 + const body_crlf = (try parseFormField(allocator, form_body, "body")) orelse try allocator.dupe(u8, ""); │ │712 defer allocator.free(body_crlf); │ │713 const body = try std.mem.replaceOwned(u8, allocator, body_crlf, "\r\n", "\n"); │ │714 defer allocator.free(body); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────╮ │895 return .{ .repo_base = base[0..segment_at], .id_bytes = id_bytes }; │ │896 } │ │897 │ │898 -// attach the posted file to the event the url names, then reload. the file is │ │898 +// attach the uploaded file to the event the url names, then reload. the file is│ │899 // the whole request body, so it streams from the socket into the object store │ │900 // without being buffered. │ │901 fn handleAttach( │ ╰─────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1017 defer author_arena.deinit(); │ │1018 const author = (try eventAuthor(io, allocator, &author_arena, request, host)) orelse return respondLoginRequired(request);│ │1019 │ │1020 - const posted = try readFormBody(request, allocator); │ │1021 - defer allocator.free(posted); │ │1022 - const body_crlf = (try parseFormField(allocator, posted, "body")) orelse try allocator.dupe(u8, ""); │ │1020 + const form_body = try readFormBody(request, allocator); │ │1021 + defer allocator.free(form_body); │ │1022 + const body_crlf = (try parseFormField(allocator, form_body, "body")) orelse try allocator.dupe(u8, ""); │ │1023 defer allocator.free(body_crlf); │ │1024 const body = try std.mem.replaceOwned(u8, allocator, body_crlf, "\r\n", "\n"); │ │1025 defer allocator.free(body); │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────╮ │1354 const title = try parseFormField(aa, body, "title"); │ │1355 const tags = try parseFormField(aa, body, "tags"); │ │1356 │ │1357 - // the hunk inputs post as d0, d1, ...; form submission normalizes their │ │1357 + // the hunk inputs are submitted as d0, d1, ...; form submission normalizes their│ │1358 // textarea line breaks to CRLF │ │1359 var hunks: std.ArrayList([]const u8) = .empty; │ │1360 var hunk_index: usize = 0; │ ╰───────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────╮ │1361 while (true) : (hunk_index += 1) { │ │1362 const name = try std.fmt.allocPrint(aa, "d{d}", .{hunk_index}); │ │1363 - const posted = (try parseFormField(aa, body, name)) orelse break; │ │1364 - try hunks.append(aa, try std.mem.replaceOwned(u8, aa, posted, "\r\n", "\n")); │ │1363 + const submitted = (try parseFormField(aa, body, name)) orelse break; │ │1364 + try hunks.append(aa, try std.mem.replaceOwned(u8, aa, submitted, "\r\n", "\n"));│ │1365 } │ │1366 │ │1367 const parts = commentBaseParts(base) orelse { │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯