Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
リダイレクト
Search
ruuuui
August 08, 2017
44
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
リダイレクト
ruuuui
August 08, 2017
More Decks by ruuuui
See All by ruuuui
TCP/IP
ruuuui
0
63
log
ruuuui
0
62
Malware
ruuuui
0
45
It’s been a while.
ruuuui
0
35
File
ruuuui
0
54
a
ruuuui
0
53
Featured
See All Featured
Navigating Weather and Climate Data
rabernat
0
560
Are puppies a ranking factor?
jonoalderson
2
4.1k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
58k
The SEO Collaboration Effect
kristinabergwall1
1
590
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
630
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.6k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
5
820
How to Think Like a Performance Engineer
csswizardry
28
2.9k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
300
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
460
Transcript
ϦμΠϨΫτॲཧʹ·ͭΘΔ੬ऑੑ Rui Arai
ϦμΠϨΫτͱɻ
ϦμΠϨΫτͱɻ • ಛఆͷϖʔδ͔Βผͷϖʔδʹసૹ͢Δ͜ͱ
ࠓճͷઅͰ ΦʔϓϯϦμΠϨΫλ੬ऑੑ HTTPϔομɾΠϯδΣΫγϣϯ
ΦʔϓϯϦμΠϨΫλ੬ऑੑʹ͍ͭͯ
ΦʔϓϯϦμΠϨΫλ੬ऑੑͱ • ҙͷυϝΠϯʹϦμΠϨΫτͰ͖ΔͷΛΦʔ ϓϯϦμΠϨΫλͱݺͼɺͦͷ੬ऑੑΛࢦ͢
ΦʔϓϯϦμΠϨΫλ੬ऑੑͱ • ྫ https://example.jp/login.php?url=http://trap.example./com ্هͷURLʹΑΓةݥͳαΠτ༠ಋ͞ΕΔ ϒϩάϝʔϧͰӾཡ͢ΔΑ͏ʹ͚·͢
੬ऑੑ͕ੜ·ΕΔݪҼ ϦμΠϨΫτઌͷURLΛ֎෦͔ΒࢦఆͰ͖Δ ϦμΠϨΫτઌͷυϝΠϯνΣοΫ͕ͳ͍
ରࡦ • ϦμΠϨΫτઌͷURLΛݻఆʹ͢Δɻ ɹˠݻఆͷURLʹ͢Δ • ϦμΠϨΫτઌͷURLΛࢦఆͤͣ൪߸ࢦఆʹ͢Δɻ ɹˠϖʔδ൪߸Λࢦఆ͠ɺURLඈ͢ • ϦμΠϨΫτઌͷυϝΠϯΛνΣοΫ͢Δɻ ɹˠ࣍
• ΫογϣϯϖʔδΛ͚Δ
ϦμΠϨΫτઌͷυϝΠϯνΣοΫ • ·͍͠ॻ͖ํ if (mb_ereg('\Ahttps?://example\.jp/[-_.!~*\'();\/?:@&=+\$,$#a-zA-Z0-9]*\z', $url)) { // νΣοΫOK }
• "http://example.jp/" ·ͨ "https://example.jp/" Ͱ࢝·Δ͜ͱ • จࣈྻͷઌ಄ɾඌΛࣔ͢ه߸ͱͯ͠ "\A" ͱ "\z" Λ༻ • "https?" httpͱhttpsͷ྆ํʹରԠ͢Δ
HTTPϔομɾΠϯδΣΫγϣϯ
HTTPϔομͷछྨ • Ϩεϙϯεϔομ • ϦΫΤετϔομ
Ϩεϙϯεϔομ ϑΟʔϧυ໊ ༰ Server Σϒαʔόͷ໊લͱόʔδϣϯใɻ Date ݱࡏͷʢάϦχοδඪ४࣌ʣ Last-Modified Ϧιʔεͷߋ৽ Content-Length
ग़ྗͷόΠτ୯Ґͷ͞ όΠφϦσʔλؚΈ·͢ɻ Content-Type ग़ྗͷMIMEλΠϓ Expires Ϧιʔεͷ༗ޮظݶ ͜ͷҎ߱ແޮͰ͢ɻΩϟογϡഁ Location ϦμΠϨΫτ URL ใ Location Ͱࢦఆ͞ΕͨϦιʔε͕ૹ৴͞Ε· Pragma ϦιʔεͷΩϟογϯάΛ༗ޮ/ແޮʹ͢ Δ Status ϦΫΤετͷεςʔλε ୯ಠϔομͱͯ͠ग़ྗ͞Ε·͢ɻ WWW-Authenticate ೝূσʔλɻ ೝূʹඞཁͳϢʔβʔ໊ύεϫʔυͳͲ Refresh ࢦఆ͞ΕͨυΩϡϝϯτΛ࠶ϩʔυ͢ Δɻ Set-Cookie σʔλΛΫϥΠΞϯτଆʹอଘ͢Δɻ Etag αʔόʔݻ༗ͷใ͕༩͞Εɺϒϥβ ΩϟογϡΛ࠶ར༻͢Δ͔Ͳ͏͔அͤ͞
HTTPϔομΠϯδΣΫγϣϯͱ <?php header('Location: ' . $_GET['url']); ͜ΕʹΑΓੜ͞ΕΔHTTPϨεϙϯεϔομҎԼͱͳΓ·͢ɻ Location: http://example/top.php Set-Cookie:
PHPSESSID=ABC http://example.jp/header.php?url=http://example/top.php%0d%0aSet-Cookie:+PHPSESSID%3DABC ։ൃऀͷҙਤ͠ͳ͍Ϩεϙϯε͕ग़ྗ͞ΕΔ ྫʣηογϣϯݻఆ߈ܸͳͲ
੬ऑੑ͕ੜ·ΕΔݪҼ • URLCookieʹվߦؚ͕·Εͯ͠·͏͜ͱͰɺى͜Δ੬ऑੑ
ରࡦ • ֎෦͔ΒͷύϥϝʔλΛϨεϙϯεϔομͱͯ͠ग़ྗ͠ͳ͍ • ҎԼͷ2ͭΛ࣮ࢪ͢Δ >ϦμΠϨΫτΫοΩʔੜઐ༻APIʹͤΔ >ϔομੜ͢ΔύϥϝʔλͷվߦΛνΣοΫ ɹྫʣվߦίʔυΤϥʔʹ͢Δ
݁ • ϦμΠϨΫτॲཧʹɺͰ͖Δ͚ͩઐ༻ͷAPIΛ͏ • ϦμΠϨΫτઌݻఆ͢Δ • ֎෦͔Βࢦఆ͢ΔϦμΠϨΫτඞͣɺจࣈछͱυϝΠϯ໊ΛνΣοΫ͢Δ