Fix random Nuxt internal server errors (#551)

* Fix random Nuxt internal server errors

* Fix ratelimit key being exposed

* Add GDPR clarification
This commit is contained in:
Geometrically
2022-06-25 16:46:10 -07:00
committed by GitHub
parent ffc8f133c9
commit 168ec9092a
19 changed files with 4426 additions and 4405 deletions

View File

@@ -625,22 +625,22 @@ export default {
const [project, members, dependencies, versions, featuredVersions] = (
await Promise.all([
data.$axios.get(`project/${data.params.id}`, data.$auth.headers),
data.$axios.get(`project/${data.params.id}`, data.$defaultHeaders()),
data.$axios.get(
`project/${data.params.id}/members`,
data.$auth.headers
data.$defaultHeaders()
),
data.$axios.get(
`project/${data.params.id}/dependencies`,
data.$auth.headers
data.$defaultHeaders()
),
data.$axios.get(
`project/${data.params.id}/version`,
data.$auth.headers
data.$defaultHeaders()
),
data.$axios.get(
`project/${data.params.id}/version?featured=true`,
data.$auth.headers
data.$defaultHeaders()
),
])
).map((it) => it.data)
@@ -764,7 +764,7 @@ export default {
moderation_message: null,
moderation_message_body: null,
},
this.$auth.headers
this.$defaultHeaders()
)
this.project.moderator_message = null
@@ -791,7 +791,7 @@ export default {
{
status: 'processing',
},
this.$auth.headers
this.$defaultHeaders()
)
this.project.status = 'processing'

View File

@@ -658,7 +658,7 @@ export default {
await this.$axios.patch(
`project/${this.newProject.id}`,
data,
this.$auth.headers
this.$defaultHeaders()
)
if (this.iconChanged) {
@@ -667,7 +667,7 @@ export default {
this.icon.type.split('/')[this.icon.type.split('/').length - 1]
}`,
this.icon,
this.$auth.headers
this.$defaultHeaders()
)
}

View File

@@ -348,7 +348,7 @@ export default {
if (item.title) url += `&title=${item.title}`
if (item.description) url += `&description=${item.description}`
await this.$axios.post(url, item.icon, this.$auth.headers)
await this.$axios.post(url, item.icon, this.$defaultHeaders())
}
for (const index of this.editGalleryIndexes) {
@@ -363,20 +363,20 @@ export default {
if (item.title) url += `&title=${item.title}`
if (item.description) url += `&description=${item.description}`
await this.$axios.patch(url, {}, this.$auth.headers)
await this.$axios.patch(url, {}, this.$defaultHeaders())
}
for (const url of this.deleteGalleryUrls) {
await this.$axios.delete(
`project/${this.project.id}/gallery?url=${encodeURIComponent(url)}`,
this.$auth.headers
this.$defaultHeaders()
)
}
const project = (
await this.$axios.get(
`project/${this.project.id}`,
this.$auth.headers
this.$defaultHeaders()
)
).data
this.$emit('update:project', project)

View File

@@ -330,7 +330,7 @@ export default {
await this.$axios.post(
`team/${this.project.team}/members`,
data,
this.$auth.headers
this.$defaultHeaders()
)
await this.updateMembers()
} catch (err) {
@@ -350,7 +350,7 @@ export default {
try {
await this.$axios.delete(
`team/${this.project.team}/members/${this.allTeamMembers[index].user.id}`,
this.$auth.headers
this.$defaultHeaders()
)
await this.updateMembers()
} catch (err) {
@@ -376,7 +376,7 @@ export default {
await this.$axios.patch(
`team/${this.project.team}/members/${this.allTeamMembers[index].user.id}`,
data,
this.$auth.headers
this.$defaultHeaders()
)
await this.updateMembers()
} catch (err) {
@@ -399,7 +399,7 @@ export default {
{
user_id: this.allTeamMembers[index].user.id,
},
this.$auth.headers
this.$defaultHeaders()
)
await this.updateMembers()
} catch (err) {
@@ -422,7 +422,10 @@ export default {
}
},
async deleteProject() {
await this.$axios.delete(`project/${this.project.id}`, this.$auth.headers)
await this.$axios.delete(
`project/${this.project.id}`,
this.$defaultHeaders()
)
await this.$store.dispatch('user/fetchProjects')
await this.$router.push(`/user/${this.$auth.user.username}`)
this.$notify({
@@ -436,7 +439,7 @@ export default {
this.allTeamMembers = (
await this.$axios.get(
`team/${this.project.team}/members`,
this.$auth.headers
this.$defaultHeaders()
)
).data.map((it) => ({
avatar_url: it.user.avatar_url,

View File

@@ -828,7 +828,10 @@ export default {
}
for (const hash of this.deleteFiles) {
await this.$axios.delete(`version_file/${hash}`, this.$auth.headers)
await this.$axios.delete(
`version_file/${hash}`,
this.$defaultHeaders()
)
}
this.version.primary_file = ['sha1', this.primaryFile.hashes.sha1]
@@ -838,15 +841,18 @@ export default {
await this.$axios.patch(
`version/${this.version.id}`,
copyVersion,
this.$auth.headers
this.$defaultHeaders()
)
const [version, featuredVersions] = (
await Promise.all([
this.$axios.get(`version/${this.version.id}`, this.$auth.headers),
this.$axios.get(
`version/${this.version.id}`,
this.$defaultHeaders()
),
this.$axios.get(
`project/${this.version.project_id}/version?featured=true`,
this.$auth.headers
this.$defaultHeaders()
),
])
).map((it) => it.data)
@@ -946,7 +952,10 @@ export default {
async deleteVersion() {
this.$nuxt.$loading.start()
await this.$axios.delete(`version/${this.version.id}`, this.$auth.headers)
await this.$axios.delete(
`version/${this.version.id}`,
this.$defaultHeaders()
)
await this.$router.replace(
`/${this.project.project_type}/${this.project.id}`