Skip to content

Commit

Permalink
feat: force update
Browse files Browse the repository at this point in the history
  • Loading branch information
JadsonLucena committed Mar 23, 2023
1 parent 5215158 commit 64ca0ec
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/MediaTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class MediaTypes {

}

update = () => {
update = (force = false) => {

return Promise.allSettled([
fetch('https://raw.githubusercontent.com/apache/httpd/trunk/docs/conf/mime.types', { // https://github.com/apache/httpd/blob/trunk/docs/conf/mime.types
Expand All @@ -188,7 +188,7 @@ class MediaTypes {
}
}).then(res => {

if (res.status == 200 && res.headers.get('etag') != this.#versions.apache) {
if (res.status == 200 && (Boolean(force) || res.headers.get('etag') != this.#versions.apache)) {

return fetch('https://raw.githubusercontent.com/apache/httpd/trunk/docs/conf/mime.types', {
headers: {
Expand All @@ -206,7 +206,7 @@ class MediaTypes {
}
}).then(res => {

if (res.status == 200 && res.headers.get('etag') != this.#versions.debian) {
if (res.status == 200 && (Boolean(force) || res.headers.get('etag') != this.#versions.debian)) {

return fetch('https://salsa.debian.org/debian/media-types/-/raw/master/mime.types', {
headers: {
Expand All @@ -224,7 +224,7 @@ class MediaTypes {
}
}).then(res => {

if (res.status == 200 && res.headers.get('etag') != this.#versions.nginx) {
if (res.status == 200 && (Boolean(force) || res.headers.get('etag') != this.#versions.nginx)) {

return fetch('https://raw.githubusercontent.com/nginx/nginx/master/conf/mime.types', {
headers: {
Expand Down

0 comments on commit 64ca0ec

Please sign in to comment.