public inbox for [email protected]
help / color / mirror / Atom feed[pgAdmin4][Patch]: SYNONYM issue if use all special characters as name
2+ messages / 2 participants
[nested] [flat]
* [pgAdmin4][Patch]: SYNONYM issue if use all special characters as name
@ 2016-10-14 14:18 Surinder Kumar <[email protected]>
2016-10-14 23:02 ` Re: [pgAdmin4][Patch]: SYNONYM issue if use all special characters as name Dave Page <[email protected]>
0 siblings, 1 reply; 2+ messages in thread
From: Surinder Kumar @ 2016-10-14 14:18 UTC (permalink / raw)
To: pgadmin-hackers
Hi
*Issue:*
If synonym name contains special characters, the request url is be '404 not
found'.
i.e. It doesn't hit at 'sql' method of synonym.
*Solution:*
If URL has an identifier containing slash character '/' into the URI, then
set param type to path.
like /<path: int>.
Because if param name contains '/' in synonym name, it gets confused and
wrong route is formed.
Reference:- http://flask.pocoo.org/snippets/76/
Please find attached patch and review.
Thanks,
Surinder Kumar
--
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers
Attachments:
[application/octet-stream] RM1622.patch (923B, 3-RM1622.patch)
download | inline diff:
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/__init__.py
index 087e26e..2d36d27 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/__init__.py
@@ -149,8 +149,13 @@ class SynonymView(PGChildNodeView):
{'type': 'int', 'id': 'did'},
{'type': 'int', 'id': 'scid'}
]
+ # If URL has an identifier containing slash character '/'
+ # into the URI, then set param type to path. Because if
+ # param name contains '/' in syid, it gets confused and
+ # wrong url is generated.
+ # Reference:- http://flask.pocoo.org/snippets/76/
ids = [
- {'type': 'string', 'id': 'syid'}
+ {'type': 'path', 'id': 'syid'}
]
operations = dict({
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: [pgAdmin4][Patch]: SYNONYM issue if use all special characters as name
2016-10-14 14:18 [pgAdmin4][Patch]: SYNONYM issue if use all special characters as name Surinder Kumar <[email protected]>
@ 2016-10-14 23:02 ` Dave Page <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: Dave Page @ 2016-10-14 23:02 UTC (permalink / raw)
To: Surinder Kumar <[email protected]>; +Cc: pgadmin-hackers
Thanks, patch applied.
On Friday, October 14, 2016, Surinder Kumar <[email protected]>
wrote:
> Hi
>
> *Issue:*
> If synonym name contains special characters, the request url is be '404
> not found'.
> i.e. It doesn't hit at 'sql' method of synonym.
>
> *Solution:*
> If URL has an identifier containing slash character '/' into the URI, then
> set param type to path.
> like /<path: int>.
> Because if param name contains '/' in synonym name, it gets confused and
> wrong route is formed.
> Reference:- http://flask.pocoo.org/snippets/76/
>
> Please find attached patch and review.
>
> Thanks,
> Surinder Kumar
>
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2016-10-14 23:02 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-10-14 14:18 [pgAdmin4][Patch]: SYNONYM issue if use all special characters as name Surinder Kumar <[email protected]>
2016-10-14 23:02 ` Dave Page <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox