Comments (2)
@tdonohue unless another volunteer wants it more I can look into this one. Very directly, it may be as simple as:
diff --git a/src/app/core/forward-client-ip/forward-client-ip.interceptor.ts b/src/app/core/forward-client-ip/forward-client-ip.interceptor.ts
index 037f69005..7fe4263d4 100644
--- a/src/app/core/forward-client-ip/forward-client-ip.interceptor.ts
+++ b/src/app/core/forward-client-ip/forward-client-ip.interceptor.ts
@@ -27,6 +27,14 @@ export class ForwardClientIpInterceptor implements HttpInterceptor {
*/
intercept(httpRequest: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
const clientIp = this.req.get('x-forwarded-for') || this.req.connection.remoteAddress;
- return next.handle(httpRequest.clone({ setHeaders: { 'X-Forwarded-For': clientIp } }));
+ const headers = { 'X-Forwarded-For': clientIp };
+
+ // if the request has a user-agent retain it
+ const userAgent = this.req.get('user-agent');
+ if (userAgent) {
+ headers['User-Agent'] = userAgent;
+ }
+
+ return next.handle(httpRequest.clone({ setHeaders: headers }));
}
}
But for a PR what would be the preference: renaming forward-client-ip
to forward-client-headers
, or creating a new set of files for forward-client-user-agent
, or just keeping it maximally simple and doing it like in the diff?
from dspace-angular.
@mark-cooper : I'm unaware of any volunteer on this ticket, and I hadn't had time to try to reproduce it myself. So, assuming you are able to reproduce this bug, then I'd be glad to assign it to you. I honestly don't have a strong preference on the proposed fix options... but it seems like either renaming to forward-client-headers
or keeping it as forward-client-ip
is reasonable.
from dspace-angular.
Related Issues (20)
- Cannot add new relationships between Entities HOT 5
- DSpace responds "soft 404" HOT 2
- media viewer struggles on loading bitstreams with restricted access conditions HOT 2
- Switching scopes on search page doesn't correctly refresh the facets/scope selector
- Page size change and sorting doesn't work on some pages HOT 5
- When deleting an author to publication relation, the author is completely remove from the item.
- An error accurs when changing the ORCID synchronization settings HOT 2
- SSR error appears on each page: `TypeError: Cannot read properties of undefined (reading 'userAgent')` HOT 2
- Access condition start/end date limits can bleed over between available options HOT 1
- HTML support on system-wide-alert HOT 3
- User profile menu remains open after menu entry is selected HOT 2
- COAR Notify: coar.notify.endorsedBy metadata not displayed in the item simple view
- COAR Notify Submitters can't accept/ignore suggestions
- Advanced Workflow actions button results in 404 page HOT 3
- Encoded `RequestParam` values increase the number of "self link...don't match" logs HOT 2
- Generate the full text link of harvested items if using "Harvest Metadata with references to bitstreams"
- Error preventing submitter to deposit a new item in DSpace 7 HOT 10
- The "Register DOI" button on the Item status page is not displayed HOT 1
- Cancelling after giving focus to Processes select dropdown, but not selecting a script, incorrectly generates an error HOT 3
- Cannot Delete an Entity which has Relationships HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dspace-angular.