Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Fix #3530, support domains up to 253 characters long
Browse files Browse the repository at this point in the history
  • Loading branch information
Moritz Brunner committed Nov 7, 2017
1 parent b40f1dd commit b12582b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions server/db-patches/patch-21-22.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE data ALTER COLUMN id TYPE character varying(270);
ALTER TABLE images ALTER COLUMN shotid TYPE character varying(270);
4 changes: 2 additions & 2 deletions server/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ CREATE TABLE accounts (
email text
);
CREATE TABLE data (
id character varying(120) NOT NULL,
id character varying(270) NOT NULL,
deviceid character varying(200),
created timestamp without time zone DEFAULT now(),
value text NOT NULL,
Expand All @@ -35,7 +35,7 @@ CREATE TABLE devices (
);
CREATE TABLE images (
id character varying(200) NOT NULL,
shotid character varying(200) NOT NULL,
shotid character varying(270) NOT NULL,
clipid character varying(200) NOT NULL,
contenttype text NOT NULL,
url text,
Expand Down
2 changes: 1 addition & 1 deletion server/src/dbschema.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const mozlog = require("./logging").mozlog("dbschema");

// When updating the database, please also run ./bin/dumpschema --record
// This updates schema.sql with the latest full database schema
const MAX_DB_LEVEL = exports.MAX_DB_LEVEL = 21;
const MAX_DB_LEVEL = exports.MAX_DB_LEVEL = 22;

exports.forceDbVersion = function(version) {
mozlog.info("forcing-db-version", {db: db.constr, version});
Expand Down
2 changes: 1 addition & 1 deletion server/src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ app.param("id", function(req, res, next, id) {
});

app.param("domain", function(req, res, next, domain) {
if (/^[^\s/]{1,100}$/.test(domain)) {
if (/^[^\s/]{1,252}$/.test(domain)) {
next();
return;
}
Expand Down

0 comments on commit b12582b

Please sign in to comment.