Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter passed URL fields #12

Closed
Offbeatmammal opened this issue Sep 22, 2011 · 3 comments
Closed

Filter passed URL fields #12

Offbeatmammal opened this issue Sep 22, 2011 · 3 comments
Assignees

Comments

@Offbeatmammal
Copy link
Owner

When passing the URL to the error reporting service there might be certain fields that - for security or clarity - may be better if stripped off.

suggestion is to add a simple array that lists the querystring parameters which should be removed from the URL when it is passed to the logging service. For robustness the replace should be case insensitive.

examples could include password hashes, sessionIDs, PII which should not be shared outside the system (though it should be noted that holding any PII on a querystring is a questionable action in itself outside a closed intranet environment)

@ghost ghost assigned Offbeatmammal Sep 27, 2011
@Offbeatmammal
Copy link
Owner Author

thinking split the querystring using something like

var queryAsArray = new Array();
var queryString = <--- pump the queryString in here
var keyValues = queryString.split(/&/);
for (var i in keyValues) {
var key = keyValues[i].split(/=/);
queryAsArray[keyValues[0]] = keyValues[1];
}

then loop through the supplied list of provided querystring parameters to drop using toLower and indexOf
if ([..the queryAsArray keys..toLower()].indexOf(paramToTest.toLower()) >= 0) {
// remove the item from the array
}

then reassemble the querystring to pass on to the jsErrLog engine...

I'm sure there's probably a neater solution but will hack this up in the next day or so unless it occurs to me ;)

@Offbeatmammal
Copy link
Owner Author

made some changes. will test, document and check in tomorrow

@Offbeatmammal
Copy link
Owner Author

Fixes added, v1.3, Commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant